windows-phone-8.1 – Windows Phone 8.1中按钮的最小尺寸

前端之家收集整理的这篇文章主要介绍了windows-phone-8.1 – Windows Phone 8.1中按钮的最小尺寸前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
普通按钮不能设置为小于109像素,RadioButtons不能小于168像素.

这些限制仅允许水平并排放置3个按钮或2个单选按钮.

有没有办法让按钮更小?

某些控件已将默认的MinHeight / MinWidth设置为ThemeResource值.您可以在定义控件时更改此值或更改其样式 – 您将在那里找到(例如在Button中):
// in Style
// ...
<Setter Property="MinHeight" Value="{ThemeResource PhoneButtonMinHeight}"/>
<Setter Property="MinWidth" Value="{ThemeResource PhoneButtonMinWidth}"/>
// ...

除非您覆盖这些值,否则在发生冲突时将遵守最低值 – at MSDN

MinWidth is one of three writable properties on FrameworkElement that specify width information. The other two are MaxWidth and Width. If there is a conflict between these values,the order of application for actual width determination is that first MinWidth must be honored,then MaxWidth,and finally,if it is within bounds,Width. All of these properties are recommendations to the layout behavior of the element’s parent in the object tree. The width of the object after layout runs is available as the ActualWidth property value.

猜你在找的Windows相关文章