ios - 查看 Controller 遏制 Z 位置

标签 ios view controller containment

我有以下问题: 我创建一个 View Controller ,并在其中添加一个 subview Controller 。 subview Controller View 插入到父 View Controller 的现有 subview (按钮 A)下方。 当我尝试转换到新的 subview Controller 时,其 View 不再添加到按钮 A 下方,而是添加到其上方。

有没有办法保持 subview 的Z位置?

最佳答案

添加新的 View Controller 后,调用:

[parentView bringSubviewToFront:theButton];

或者,使用 insertSubview:belowSubview: 插入新的 View Controller ,并为 belowSubview: 参数指定按钮。

关于ios - 查看 Controller 遏制 Z 位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18383895/

相关文章:

android - 如何在Android中动态添加表格中的字段?

ios - 此 iOS SDK 不支持手机上的 iOS 版本

sql - 如果有代理键,需要单独的表吗?

iOS 7 自定义键盘 UIView 触地事件在底行延迟

objective-c - 使用 presentModalViewController 时自定义/覆盖 View 大小

ruby-on-rails - 按照 RoR 约定从类名中检索 Controller 名称

Java JPanel 移动(keylistener)不工作

javascript - ruby 轨道 : Calling controller method from javascript

ios - 配置了应用内购买的所有设置,但我的产品数量仍然是 0 - Swift 4

ios - 在实时输入字符时,如何获取 UITextfield 的值?