Windows Phone 8.1 中按钮的最小尺寸 [英] Minimum Sizes for Buttons in Windows Phone 8.1

查看:24
本文介绍了Windows Phone 8.1 中按钮的最小尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

普通按钮不能小于109px,RadioButtons不能小于168px.

Ordinary buttons can not be set smaller than 109 px, RadioButtons not smaller than 168px.

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

These limits allow only to place 3 buttons or 2 radio buttons horizontally side by side.

有没有办法让按钮变小?

Is there a way to make the buttons smaller?

推荐答案

某些控件已将MinHeight/MinWidth设为ThemeResource 值.您可以在定义 Control 或更改其 Style 时更改此值 - 您会在那里找到(例如在 Button 中):

Some Controls have set as default MinHeight/MinWidth to ThemeResource value. You may change this value while defining a Control or change its Style - you will find there (for example in Button):

// in Style
// ...
<Setter Property="MinHeight" Value="{ThemeResource PhoneButtonMinHeight}"/>
<Setter Property="MinWidth" Value="{ThemeResource PhoneButtonMinWidth}"/>
// ...

除非您覆盖这些值,否则在发生冲突时将遵循最小值 - 在 MSDN:

Unless you override those values, the minimum will be honored where there is a conflict - at MSDN:

MinWidth 是 FrameworkElement 的三个可写属性之一,用于指定宽度信息.另外两个是 MaxWidth 和 Width.如果这些值之间存在冲突,则实际宽度确定的应用顺序是首先必须遵守 MinWidth,然后是 MaxWidth,最后,如果它在边界内,则是 Width.所有这些属性都是对对象树中元素父级的布局行为的建议.布局运行后对象的宽度可用作 ActualWidth 属性值.

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 Phone 8.1 中按钮的最小尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆