菜鸟教程小白 发表于 2022-12-12 16:25:23

ios - 在 UINavigationController 层次结构中共享公共(public)背景图像?


                                            <p><p>我知道可以为 UINavigationBar 设置背景图像,但我想知道是否有办法为 UINavigationController 中的所有 Controller 共享公共(public)背景 View 。这个想法是让 UIImageView 作为背景保持原位,而不是在导航到新 Controller 时“滑动”自身。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>导航 Controller 是一种 ViewController ,它通过将 VCView 添加到其 View 来托管当前可见的 ViewController 。您也可以向该 View 添加内容。创建您的 ImageView 并将其添加为导航 ControllerView 的 subview ,然后将其发送到后面(或在索引 0 处插入)。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 在 UINavigationController 层次结构中共享公共(public)背景图像?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/20028721/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/20028721/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 在 UINavigationController 层次结构中共享公共(public)背景图像?