我使用Button控件,发现始终存在间距
比如我在声明了一个Grid 第二行高度为60,里面放button,高度也声明为60,但是始终填充不满,感觉缩小了一些
我又把button放到grid外,实际也像是缩小了一些,不知道为什么?
<Button Height="60" Width="460" HorizontalAlignment="Center" Name="LoadMore" Margin="0" Padding="0" Background="#FF23B8C6" Foreground="White" Content="更多..." FontSize="22" VerticalAlignment="Bottom"/>
------解决思路----------------------
Button的模板其实是有外框的,那个Border有设置过Margin属性,自己重写一个模板就好了。
------解决思路----------------------
<Button Height="60" Width="460" HorizontalAlignment="Center" Name="LoadMore" Margin="-12" Padding="0" Background="#FF23B8C6" Foreground="White" Content="更多..." FontSize="22" VerticalAlignment="Bottom"/>
这个控件内部有对外的mrgin:12,写成 Margin="-12" 抵消就行了