当前位置: 代码迷 >> Windows Mobile >> 关于Windows Phone 中 Button控件高度有关问题
  详细解决方案

关于Windows Phone 中 Button控件高度有关问题

热度:68   发布时间:2016-04-25 07:09:28.0
关于Windows Phone 中 Button控件高度问题
我使用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" 抵消就行了
  相关解决方案