c# - xamarin 中的网格样式
问题描述
我正在使用带有 xamarin 表单的 css 样式。我有网格按钮:
StackLayout {
background-color: #1e1e1e;
color: #ffffff;
}
Button{
background-color: #2d2d30;
font-family: Consolas;
font-size: 24;
margin: 0;
}
和 xaml:
<Grid>
<Grid.ColumnDefinitions>
/*...*/
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
/*...*/
</Grid.RowDefinitions>
<Button/>
<Button/>
/*...*/
</Grid>
如何消除按钮之间的这种间隙?
解决方案
这是内联块元素问题。如你看到的:
button {
width: 50px;
height: 50px;
background: #000;
outline:none;
border:none;
margin:0;
}
<button></button>
<button></button>
<button></button>
我们可以使用这两种方法来消除差距。
- 相邻写
button {
width: 50px;
height: 50px;
background: #000;
outline:none;
border:none;
}
<button></button><button></button><button></button>
- 评论行
button {
width: 50px;
height: 50px;
background: #000;
outline:none;
border:none;
}
<button></button><!--
--><button></button><!--
--><button></button>
推荐阅读
- c# - .NETCORE.UWP 6.1.5 中的 IsRandomAccessRequired
- asp.net-mvc - 如何使用 HTTPS 保护我的 GCP Windows 实例连接?
- xml - xml:space="preserve" 对 XML 属性之间的空间的影响?
- ios - 如何在 swift 4 中访问项目密钥
- android - 线程离线时如何停止服务?
- java - 订单活动在空点引用上崩溃
- javascript - Reactjs - 排序 if else 和外部块
- javascript - CSS 和 Javascript 下拉导航未显示
- angular - Angular中两个以上领域的两种方式绑定
- c# - 对数据库进行过滤。收到的错误必须声明标量变量