简体   繁体   English

如何使用xcode接口构建器向UIButton添加填充?

[英]How do I add padding to a UIButton using the xcode interface builder?

I'm using a 32 point icon as a button and I'm trying to increase the tappable area to 44 points to meet Apple's guidelines. 我使用32点图标作为按钮,并试图将可轻按的区域增加到44点,以满足Apple的要求。 Can I do this using the interface building instead of code? 我可以使用界面构建代替代码来做到这一点吗? Thanks for your help! 谢谢你的帮助!

Yes you can. 是的你可以。

Just use the height you want in your button (44x44, per instance) and set the icon as image, not as background. 只需在按钮中使用所需的高度(每个实例44x44),然后将图标设置为图像,而不是背景即可。

在此处输入图片说明

You can use the constraint view in the right corner: 您可以使用右上角的约束视图:


约束视图

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在不通过Interface Builder获得UIButton类的背景的情况下添加图像? - how do I add an image without getting the background of the UIButton class via Interface Builder? 如何使用Interface Builder在其他UI元素的背景中添加UIButton? - How to add a UIButton in the background of other UI elements using Interface Builder? 如何在Interface Builder中将子视图添加到UIButton - How can I addSubview to UIButton in Interface Builder 如何在Xcode Interface Builder中向表视图控制器(带有静态单元格)添加导航项? - How do I add a navigation item to a Table View Controller (with static cells) in Xcode Interface Builder? 如何在界面生成器 (Xcode 9) 中工作的 UIButton 子类中设置默认标题 - How to set a default title in UIButton subclass that works in Interface Builder (Xcode 9) 如何在 XCode Interface Builder 中设置 UIButton 的选定图像 - How to set selected image of UIButton in XCode Interface Builder Xcode 6 Interface Builder如何使UIView的宽度为100%? - Xcode 6 Interface Builder how do I make a UIView 100% width? 如何在Xcode 9中将自动调整大小应用于Interface Builder? - How do I apply Autoresizing to Interface Builder in Xcode 9? 如何在Interface Builder中显示备用语言? (Xcode5) - How do I display alternate languages in Interface Builder? (Xcode5) 如何在XCode界面生成器中删除退出序列? - How do I remove an exit segue in XCode interface builder?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM