[英]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.