gpt4 book ai didi

ios - 查看 Controller 遏制 Z 位置

转载 作者:行者123 更新时间:2023-11-29 03:41:29 25 4
gpt4 key购买 nike

我有以下问题:我创建一个 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com