1. <legend id='Aerq7'><style id='Aerq7'><dir id='Aerq7'><q id='Aerq7'></q></dir></style></legend>

      <tfoot id='Aerq7'></tfoot>

        <small id='Aerq7'></small><noframes id='Aerq7'>

        <i id='Aerq7'><tr id='Aerq7'><dt id='Aerq7'><q id='Aerq7'><span id='Aerq7'><b id='Aerq7'><form id='Aerq7'><ins id='Aerq7'></ins><ul id='Aerq7'></ul><sub id='Aerq7'></sub></form><legend id='Aerq7'></legend><bdo id='Aerq7'><pre id='Aerq7'><center id='Aerq7'></center></pre></bdo></b><th id='Aerq7'></th></span></q></dt></tr></i><div id='Aerq7'><tfoot id='Aerq7'></tfoot><dl id='Aerq7'><fieldset id='Aerq7'></fieldset></dl></div>
          <bdo id='Aerq7'></bdo><ul id='Aerq7'></ul>
      1. 不使用整个屏幕的导航控制器

        时间:2023-06-10

        <tfoot id='Wkp9V'></tfoot>

            <small id='Wkp9V'></small><noframes id='Wkp9V'>

            • <legend id='Wkp9V'><style id='Wkp9V'><dir id='Wkp9V'><q id='Wkp9V'></q></dir></style></legend>
              • <bdo id='Wkp9V'></bdo><ul id='Wkp9V'></ul>
                  <tbody id='Wkp9V'></tbody>
                • <i id='Wkp9V'><tr id='Wkp9V'><dt id='Wkp9V'><q id='Wkp9V'><span id='Wkp9V'><b id='Wkp9V'><form id='Wkp9V'><ins id='Wkp9V'></ins><ul id='Wkp9V'></ul><sub id='Wkp9V'></sub></form><legend id='Wkp9V'></legend><bdo id='Wkp9V'><pre id='Wkp9V'><center id='Wkp9V'></center></pre></bdo></b><th id='Wkp9V'></th></span></q></dt></tr></i><div id='Wkp9V'><tfoot id='Wkp9V'></tfoot><dl id='Wkp9V'><fieldset id='Wkp9V'></fieldset></dl></div>
                  本文介绍了不使用整个屏幕的导航控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个导航控制器,我不想用完整个屏幕.特别是,我想在屏幕顶部的栏中放置一个徽标图像.不幸的是,导航控制器似乎不是这样设计的.在界面生成器中,我不能让它占据屏幕的一部分.您将如何实现顶部的徽标图像和占据屏幕其余部分的导航控制器的效果?

                  解决方案

                  我自己没有这样做,但应该很简单.您需要一个包装视图控制器作为其父级(我们称之为 MyWrapperViewController),其视图层次结构最终可能如下所示:

                  <上一页>UIView -+(连接到 MyWrapperViewController 中的视图出口)|+-- UIView(你的标志放在这里)|+-- UIView(子"导航控制器的视图)

                  徽标视图可以是 UIViewUIImageView 或任何适合内容的类.

                  当您在某处为您的 MyWrapperViewController 类创建 UINavigationController 时,您可以调整其 view bounds 的大小小于全屏(可能是屏幕大小减去您的徽标大小,并带有适当的 origin 偏移量,因此它位于徽标下方),然后将其添加为子视图.

                  I have a navigation controller which I don't want to use up the whole screen. In particular, I want to put a logo image in a bar at the top of the screen. Unfortunately, the navigation controller doesn't seem to be designed this way. In interface builder, I can't make it take up part of a screen. How would you achieve the effect of a logo image up the top and a navigation controller taking up the rest of the screen?

                  解决方案

                  I haven't done this myself, but it should be pretty straight-forward. You'll need a wrapper view controller to be its parent (let's call it MyWrapperViewController), and its view hierarchy might ultimately look something like this:

                  UIView -+ (hooked up to the view outlet in MyWrapperViewController)
                          |
                          +-- UIView (Your logo goes here)
                          |
                          +-- UIView (The "child" navigation controller's view)
                  

                  The logo view can be a UIView, or a UIImageView, or whatever class is appropriate for the content.

                  When you create a UINavigationController somewhere for your MyWrapperViewController class, you can resize its view bounds to something smaller than full-screen (perhaps the size of the screen minus the size of your logo, with an appropriate origin offset so it's below the logo), and then add it as a subview.

                  这篇关于不使用整个屏幕的导航控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:UINavigation 推送新的根控制器 下一篇:如何进入“主页"在 iOS 应用程序中?

                  相关文章

                • <small id='oXKyC'></small><noframes id='oXKyC'>

                  <i id='oXKyC'><tr id='oXKyC'><dt id='oXKyC'><q id='oXKyC'><span id='oXKyC'><b id='oXKyC'><form id='oXKyC'><ins id='oXKyC'></ins><ul id='oXKyC'></ul><sub id='oXKyC'></sub></form><legend id='oXKyC'></legend><bdo id='oXKyC'><pre id='oXKyC'><center id='oXKyC'></center></pre></bdo></b><th id='oXKyC'></th></span></q></dt></tr></i><div id='oXKyC'><tfoot id='oXKyC'></tfoot><dl id='oXKyC'><fieldset id='oXKyC'></fieldset></dl></div>

                    <legend id='oXKyC'><style id='oXKyC'><dir id='oXKyC'><q id='oXKyC'></q></dir></style></legend>

                      <tfoot id='oXKyC'></tfoot>

                      • <bdo id='oXKyC'></bdo><ul id='oXKyC'></ul>