【发布时间】:2015-01-07 03:39:23
【问题描述】:
我在屏幕上有许多标签和按钮。为了让用户点击屏幕上的任意位置,我创建了一个 UIButton(“wholeScreenButton”),使其背景清晰,并使其与 superview 大小相同。现在在运行时,我使用下面的代码将按钮置于其他标签之上。
self.wholeScreenButton.bringSubviewToFront(self.wholeScreenButton)
但它不起作用。用户仍然可以点击一些应该位于 wholeScreenButton 下方并且应该无法访问的按钮。 我做错了什么?
【问题讨论】:
标签: ios swift xcode cocoa-touch uiview