- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
对于 Windows 8 应用程序,我可以使用“Segoe UI Symbol”创建 AppBar 样式按钮,但它们绘制在矩形区域中,因此具有矩形背景。因为我想在悬停期间将它们的背景设置为不同的颜色,所以我需要去掉这个矩形。
正如下面问题所指出的,按钮和样式的定义如下所示。
请给出如何实现的方向。
HTML:
<button id="myAppBarIcon" class="normal-size-icon"></button>
CSS:
.normal-size-icon {
margin-top: 400px;
margin-left: 630px;
position: relative;
font-size: 24px;
font-family: 'Segoe UI Symbol';
color: rgb(255, 255, 255);
background: none;
border: none;
}
更新:
下面的代码可以解决问题,但字体没有正确对齐。可能是因为它没有正确对齐。下图显示了布局。
.normal-size-icon {
font-size: 24px;
font-family: 'Segoe UI Symbol';
color: rgb(555, 255, 255);
min-width: 0;
min-height: 0;
border-radius: 50%;
border-style: solid;
padding: 0;
text-align: center;
}
最佳答案
为此,您需要设置 border-radius:50%;
这样您的按钮就会变成圆形,然后添加 min-width:0; min-height:0;
和 text-align:center;
这是完整的 css:
.normal-size-icon {
font-size: 24px;
font-family: 'Segoe UI Symbol';
color: rgb(555, 255, 255);
min-width: 0;
min-height: 0;
border-radius: 50%;
border-style: solid;
padding: 0;
text-align: center;
}
如果不需要边框可以设置border:none;
。抱歉我的英语不好
关于html - Windows 8 : Creating AppBar Style Buttons with HTML5/CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14204763/
我遇到过这个 html: 上面的html和这个有什么区别: 最佳答案 来自MDN page on the tag : 对于 type 的属性标签,可能的值是: 提交:按钮将表单数据提交给服务器
Button button= (Button) findViewbyID(R.id.button); 和 Button button = new Button(this); 有什么区别? 最佳答案 有
我是一名优秀的程序员,十分优秀!