[英]How to add a UIButton in the background of other UI elements using Interface Builder?
I have to add a UIButton in the background of a View I already layout and position different UI elements on. 我必须在已经布局并放置不同UI元素的View的背景中添加UIButton。 I need to do this to resign first responder when user leave keyboard.
用户离开键盘时,我需要执行此操作以辞退第一响应者。 But this button goes to foreground and I really don't know how to proceed.
但是这个按钮进入了前台,我真的不知道该如何进行。 Any idea ?
任何想法 ?
Thx for helping, 感谢您的帮助,
Stephane 斯蒂芬
UIButton is a subclass of UIview You have a UIView in place now change its class from inspector, and make the style default so it looks like a plain view but with other controls inside it(as it is basically a view ). UIButton是UIview的子类。您现在有一个UIView,可以从检查器中更改其类,并将样式设置为默认,以便它看起来像纯视图,但内部带有其他控件(因为它基本上是view)。 Wire it and use it
连线并使用
Regards, Jackson Sunny Rodrigues 此致,杰克逊·桑尼·罗德里格斯(Jackson Sunny Rodrigues)
I found the solution. 我找到了解决方案。 I just needed to add the button in the top of the UI elements list in the Objects panel.
我只需要在“对象”面板的UI元素列表顶部添加按钮。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.