• <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 导航栏上绘制自定义后退按钮

      时间:2023-06-12

    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 导航栏上绘制自定义后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:向没有导航控制器的视图添加导航栏 下一篇:UINavigationItem titleView“如果设置了leftBarButtonItem则忽略"?

                相关文章

                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>
                2. <small id='Wv8dr'></small><noframes id='Wv8dr'>

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

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