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

  • <tfoot id='ip13d'></tfoot>

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

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

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

      1. 将 UINavigationController 的工具栏移到顶部以位于导航栏下方

        时间:2023-06-11
          <i id='GsEiL'><tr id='GsEiL'><dt id='GsEiL'><q id='GsEiL'><span id='GsEiL'><b id='GsEiL'><form id='GsEiL'><ins id='GsEiL'></ins><ul id='GsEiL'></ul><sub id='GsEiL'></sub></form><legend id='GsEiL'></legend><bdo id='GsEiL'><pre id='GsEiL'><center id='GsEiL'></center></pre></bdo></b><th id='GsEiL'></th></span></q></dt></tr></i><div id='GsEiL'><tfoot id='GsEiL'></tfoot><dl id='GsEiL'><fieldset id='GsEiL'></fieldset></dl></div>
          • <legend id='GsEiL'><style id='GsEiL'><dir id='GsEiL'><q id='GsEiL'></q></dir></style></legend>

                <tfoot id='GsEiL'></tfoot>
                  <bdo id='GsEiL'></bdo><ul id='GsEiL'></ul>
                • <small id='GsEiL'></small><noframes id='GsEiL'>

                    <tbody id='GsEiL'></tbody>
                  本文介绍了将 UINavigationController 的工具栏移到顶部以位于导航栏下方的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  当你创建一个 UINavigationController 时,你可以通过 setToolbarHidden:animated: 显示它默认隐藏的 UIToolbar (或者通过检查 Shows Toolbar in Interface建设者).这会导致一个工具栏出现在屏幕底部,并且该工具栏在导航堆栈上的视图控制器的推送和弹出之间持续存在.这正是我所需要的,除了我需要将工具栏放在屏幕的 top 上.看来这正是 Apple 对 iTunes 应用所做的:

                  When you create a UINavigationController, you can reveal its default hidden UIToolbar via setToolbarHidden:animated: (or by checking Shows Toolbar in Interface Builder). This causes a toolbar to appear at the bottom of the screen, and this toolbar persists between pushing and popping of view controllers on the navigation stack. That is exactly what I need, except I need the toolbar to be located at the top of the screen. It appears that's exactly what Apple has done with the iTunes app:

                  如何将 UINavigationController 的工具栏移动到顶部以位于导航栏下方而不是底部?

                  How can one move UINavigationController's toolbar to the top to lie underneath the navigation bar instead of at the bottom?

                  我尝试实现 UIToolbarDelegate,覆盖 positionForBar:,并返回 UIBarPosition.TopAttachedUIBarPosition.Topself.navigationController?.toolbardelegate 设置为 self 之后,但这甚至没有调用委托方法,因此它没有'不改变条形位置.

                  I've tried to implement the UIToolbarDelegate, override positionForBar:, and return UIBarPosition.TopAttached or UIBarPosition.Top after setting the delegate of self.navigationController?.toolbar to self, but this did not even call the delegate method therefore it didn't change the bar position.

                  请注意,我需要在导航之间保留工具栏,因此我不能简单地将工具栏添加到视图控制器并将其放置在导航栏下方.

                  Note that I need the toolbar to be preserved between navigation, so I can't simply add a toolbar to a view controller and position it under the nav bar.

                  推荐答案

                  你可能创建的不是 UITableViewController 而是 UIViewController.鉴于 UIViewController 将 UIToolBar 放在 NavigationBar 和 UITableView 下方.将所有必要的 UITableView 列表委托给 UIViewController,仅此而已.为什么要使用 UIViewController 而不是 UITableViewController?因为 tableView 不会有静态位置元素.你应该有一些不包含 ScrollView 的东西.在这种情况下,它只是 UIView.你也可以对 tableView 的 UIScrollView 做一些修改,但我认为描述的方法更容易.

                  You may create not UITableViewController but UIViewController. In view of UIViewController place UIToolBar below NavigationBar and UITableView. Delegate all necessary list of UITableView to UIViewController and thats all. Why should you use UIViewController instead UITableViewController? Because tableView will not have statical positions elements. You should have something that not contains ScrollView. In this situation it is only UIView. Also you may do some hack with UIScrollView of tableView but I think described method is easer.

                  这篇关于将 UINavigationController 的工具栏移到顶部以位于导航栏下方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:设置 navigationController.hidesBarsOnSwipe = YES 不再显示我的导航栏 下一篇:UINavigationController 中未显示简单标题

                  相关文章

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

                    2. <small id='1Gi9f'></small><noframes id='1Gi9f'>

                      <legend id='1Gi9f'><style id='1Gi9f'><dir id='1Gi9f'><q id='1Gi9f'></q></dir></style></legend>