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

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

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

      如何在 UINavigationBar 上设置后退按钮的文本?

      How to set the text of a back button on a UINavigationBar?(如何在 UINavigationBar 上设置后退按钮的文本?)
    2. <small id='DZteP'></small><noframes id='DZteP'>

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

          <tbody id='DZteP'></tbody>

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

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

              1. <tfoot id='DZteP'></tfoot>
              2. 本文介绍了如何在 UINavigationBar 上设置后退按钮的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..
                <块引用>

                可能重复:
                如何更改“back” 的标题导航栏上的按钮

                情况:
                我有一个由导航控制器管理的 UIViewController.我可以通过简单地调用 self.title = @"title" 来设置覆盖 UIViewController 的导航栏的 title.但是,我也希望能够设置导航栏的后退按钮文本(对于不同的语言,例如......)

                问题:
                我不知道如何设置后退按钮的文字.

                问题:
                如何设置 UINavigation 栏的后退按钮(编程方式不在 IB 中)?

                解决方案

                setTitle 方式 - 虽然看起来可行,但不正确.如果您仔细观察,您会注意到导航项更改为新标题,而新视图通过 pushViewController 动画进入视图.您必须在 viewWillAppear 中恢复您的标题这一事实很笨拙,这进一步表明了它的黑客性质.

                正确的做法是在你的pushViewController之前做如下操作:

                <上一页>UIBarButtonItem *backButton = [[UIBarButtonItem alloc]initWithTitle: @"返回按钮文本"样式:UIBarButtonItemStyleBordered目标:无行动:无];[self.navigationItem setBackBarButtonItem: backButton];[返回按钮释放];

                Possible Duplicate:
                How do I change the title of the “back” button on a Navigation Bar

                The Situation:
                I have a UIViewController that is governed by a navigation controller. I am able to set the title of the navigation bar covering the UIViewController by simply calling self.title = @"title". But, I want to be able to set the back button text of the navigation bar, too (for different languages n' such..)

                The Problem:
                I don't know how to set the back button's text.

                The Question:
                How do I set the back button of the UINavigation bar (programmatically not in IB)?

                解决方案

                The setTitle way - though may seem to work, is incorrect. If you pay attention closely, you will notice that the navigation item changes to the new title while the new view is animated into view via pushViewController. The fact that you have to restore your title in viewWillAppear is kludgy, which further suggests its hack nature.

                The correct way is to do the following before your pushViewController:

                UIBarButtonItem *backButton = [[UIBarButtonItem alloc] 
                                                initWithTitle: @"Back Button Text" 
                                                style: UIBarButtonItemStyleBordered
                                                target: nil action: nil];
                
                [self.navigationItem setBackBarButtonItem: backButton];
                [backButton release];
                
                

                这篇关于如何在 UINavigationBar 上设置后退按钮的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                UIImageView Gestures (Zoom, Rotate) Question(UIImageView 手势(缩放、旋转)问题)
                Responsive website on iPhone - unwanted white space on rotate from landscape to portrait(iPhone上的响应式网站-从横向旋转到纵向时不需要的空白)
                How to rotate an image 90 degrees on iOS?(如何在 iOS 上将图像旋转 90 度?)
                How to capture current view screenshot and reuse in code? (iPhone SDK)(如何捕获当前视图屏幕截图并在代码中重用?(iPhone SDK))
                iOS 6 shouldAutorotate: is NOT being called(iOS 6 shouldAutorotate: 没有被调用)
                What is the PastryKit Framework?(PastryKit 框架是什么?)
              3. <i id='gvlTY'><tr id='gvlTY'><dt id='gvlTY'><q id='gvlTY'><span id='gvlTY'><b id='gvlTY'><form id='gvlTY'><ins id='gvlTY'></ins><ul id='gvlTY'></ul><sub id='gvlTY'></sub></form><legend id='gvlTY'></legend><bdo id='gvlTY'><pre id='gvlTY'><center id='gvlTY'></center></pre></bdo></b><th id='gvlTY'></th></span></q></dt></tr></i><div id='gvlTY'><tfoot id='gvlTY'></tfoot><dl id='gvlTY'><fieldset id='gvlTY'></fieldset></dl></div>
                <legend id='gvlTY'><style id='gvlTY'><dir id='gvlTY'><q id='gvlTY'></q></dir></style></legend>
                • <bdo id='gvlTY'></bdo><ul id='gvlTY'></ul>
                • <small id='gvlTY'></small><noframes id='gvlTY'>

                      <tbody id='gvlTY'></tbody>

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