OGeek|极客世界-中国程序员成长平台

标题: ios - 在 UINavigationController 层次结构中共享公共(public)背景图像? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 16:25
标题: ios - 在 UINavigationController 层次结构中共享公共(public)背景图像?

我知道可以为 UINavigationBar 设置背景图像,但我想知道是否有办法为 UINavigationController 中的所有 Controller 共享公共(public)背景 View 。这个想法是让 UIImageView 作为背景保持原位,而不是在导航到新 Controller 时“滑动”自身。



Best Answer-推荐答案


导航 Controller 是一种 View Controller ,它通过将 VC View 添加到其 View 来托管当前可见的 View Controller 。您也可以向该 View 添加内容。创建您的 ImageView 并将其添加为导航 Controller View 的 subview ,然后将其发送到后面(或在索引 0 处插入)。

关于ios - 在 UINavigationController 层次结构中共享公共(public)背景图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20028721/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4