如何以编程方式将UIButton发送到前台。我将 UIButton 拖放到 Storyboard UIView 中,并且创建了另一个自定义 UIView 以在按钮操作触发后显示另一个 View 。
最佳答案
UIView有许多方法允许您修改 View 层次结构。
bringSubviewToFront:
sendSubviewToBack:
insertSubview:atIndex:
insertSubview:aboveSubview:
insertSubview:belowSubview:
exchangeSubviewAtIndex:withSubviewAtIndex:
由于您的 View 已经插入到您的 super View 中,因此您可以轻松调用 bringSubviewToFront: 每个 View 一次,无论您喜欢什么顺序。
关于swift - 以编程方式快速发送到自定义创建 View 中的前端 UIButton,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29454906/