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

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

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

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

      <tfoot id='FKulb'></tfoot>
    1. 在 iPhone 导航栏上绘制自定义后退按钮

      Draw custom Back button on iPhone Navigation Bar(在 iPhone 导航栏上绘制自定义后退按钮)

    2. <legend id='5uhq6'><style id='5uhq6'><dir id='5uhq6'><q id='5uhq6'></q></dir></style></legend>
      <tfoot id='5uhq6'></tfoot>
        • <bdo id='5uhq6'></bdo><ul id='5uhq6'></ul>
          <i id='5uhq6'><tr id='5uhq6'><dt id='5uhq6'><q id='5uhq6'><span id='5uhq6'><b id='5uhq6'><form id='5uhq6'><ins id='5uhq6'></ins><ul id='5uhq6'></ul><sub id='5uhq6'></sub></form><legend id='5uhq6'></legend><bdo id='5uhq6'><pre id='5uhq6'><center id='5uhq6'></center></pre></bdo></b><th id='5uhq6'></th></span></q></dt></tr></i><div id='5uhq6'><tfoot id='5uhq6'></tfoot><dl id='5uhq6'><fieldset id='5uhq6'></fieldset></dl></div>
              <tbody id='5uhq6'></tbody>

            <small id='5uhq6'></small><noframes id='5uhq6'>

              1. 本文介绍了在 iPhone 导航栏上绘制自定义后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个带有 NavigationBar 的 UIView,我想添加一个看起来像后退按钮样式的按钮.我没有使用 UINavigationController 并且想知道如果没有它是否可以完成?

                I've got a UIView with a NavigationBar and I'd like to add a button which looks like the style of a Back Button. I'm not using a UINavigationController and was wondering if this could be done without it?

                按钮的样式应该是这样的:

                The style of the button should look like this:

                谢谢

                推荐答案

                您需要设置一个自定义堆栈的 UINavigationItem 对象并将它们推送到 UINavigationBar.这是我所知道的获得真正后退按钮的唯一方法.我没有测试过这段代码,但你应该这样做:

                You need to set up a custom stack of UINavigationItem objects and push them on to the UINavigationBar. This is the only way I know of to get a true back button. I haven't tested this code, but you should do something like this:

                UINavigationItem *previousItem =
                    [[[UINavigationItem alloc] initWithTitle:@"Back title"] autorelease];
                
                UINavigationItem *currentItem =
                    [[[UINavigationItem alloc] initWithTitle:@"Main Title"] autorelease];
                
                [navigationBar setItems:[NSArray arrayWithObjects:previousItem, currentItem, nil]
                               animated:YES];
                

                要在按下按钮时进行处理,您应该将自己设置为导航栏的委托并实现 UINavigationBarDelegate 委托.

                To handle when the buttons are pressed you should set yourself as the navigation bar's delegate and implement the UINavigationBarDelegate delegates.

                这篇关于在 iPhone 导航栏上绘制自定义后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                UINavigationController inside a UITabBarController inside a UISplitViewController presented modally on iPhone(UISplitViewController 内的 UITabBarController 内的 UINavigationController 以模态方式呈现在 iPhone 上) - IT屋-程序员软件开发技术分
                ViewController in UINavigationController orientation change(UINavigationController 中的 ViewController 方向更改)
                Custom back button in UINavigationController(UINavigationController 中的自定义后退按钮)
                How to get the previous viewcontroller that pushed my current view(如何获取推送我当前视图的上一个视图控制器)
                The correct way to set a light status bar text color in iOS 7 based on different ViewControllers(iOS 7中基于不同ViewControllers设置灯光状态栏文字颜色的正确方法)
                Show UITabBar when UIViewController pushed(推送 UIViewController 时显示 UITabBar)
                1. <i id='Wv8dr'><tr id='Wv8dr'><dt id='Wv8dr'><q id='Wv8dr'><span id='Wv8dr'><b id='Wv8dr'><form id='Wv8dr'><ins id='Wv8dr'></ins><ul id='Wv8dr'></ul><sub id='Wv8dr'></sub></form><legend id='Wv8dr'></legend><bdo id='Wv8dr'><pre id='Wv8dr'><center id='Wv8dr'></center></pre></bdo></b><th id='Wv8dr'></th></span></q></dt></tr></i><div id='Wv8dr'><tfoot id='Wv8dr'></tfoot><dl id='Wv8dr'><fieldset id='Wv8dr'></fieldset></dl></div>
                    <legend id='Wv8dr'><style id='Wv8dr'><dir id='Wv8dr'><q id='Wv8dr'></q></dir></style></legend>
                        <tbody id='Wv8dr'></tbody>

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

                        <bdo id='Wv8dr'></bdo><ul id='Wv8dr'></ul>

                          <tfoot id='Wv8dr'></tfoot>