Windows Phone 7 按钮“边框" [英] Windows phone 7 button "borders"

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

问题描述

默认情况下,WP7 按钮周围是 5ish 像素的黑色空间.我想删除它,但我已经尝试将 Margin、BorderThickness、Padding 属性设置为 Thinkness 为零,但这似乎对这个神秘的空间没有影响.任何线索这个空间到底是什么以及我如何摆脱它.

By default WP7 buttons are surrounded by a black space of 5ish pixels. I'd like to remove this, but I've tried setting the Margin, BorderThickness, Padding properties to be a Thinkness of zero, but this seems to have no effect on this mysterious space. Any clues what exactly this spaces is and how I might get rid of it.

谢谢,

罗伯特

推荐答案

这个边框是专门用来增加按钮的大小作为触摸目标的.有了这个填充,人们可以更轻松地确保他们正在触摸他们想要的控件.
如果您试图删除它以适应页面上的更多控件,请注意您可能会让用户更容易意外点击错误的控件.

This border is specifically added to increase the size of the button as a touch target. Having this padding makes it easier for people to be sure that they are touching the control they are aiming for.
If you are trying to remove this to fit more controls on the page be aware you're probably making it easier for users to accidentally tap the wrong control.

如果你真的必须这样做,你必须重新设计按钮控件.

If you really must do this you must retemplate the button control.

您需要对默认模板做出的唯一区别(您可以从 Blend 获得该模板的副本)是将控制器上的边距从

The only difference you need to make to the default template (you can get a copy of this from Blend) is to change the margin on the controller from

 <Border ... Margin="{StaticResource PhoneTouchTargetOverhang}">

任何适合您的值.

另请注意,通过更改此值,您可能会在引入小屏幕设备时给自己带来问题.

Please also note that by changing this value you're likely to create issues for yourself when smaller screen devices are introduced.

这篇关于Windows Phone 7 按钮“边框"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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