<tfoot id='jxlBC'></tfoot><legend id='jxlBC'><style id='jxlBC'><dir id='jxlBC'><q id='jxlBC'></q></dir></style></legend>

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

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

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

    1. 导航栏中带有返回按钮的 UISegmentedControl

      时间:2023-06-10

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

          <small id='8M3Ss'></small><noframes id='8M3Ss'>

            <bdo id='8M3Ss'></bdo><ul id='8M3Ss'></ul>

            1. <tfoot id='8M3Ss'></tfoot>
              1. 本文介绍了导航栏中带有返回按钮的 UISegmentedControl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在以编程方式将 UISegmentedControl 添加到导航栏 titleView 应该在的位置.但正如 Apple docs 所提到的在 titleView 下,如果 leftBarButtonItem 不为 nil,则忽略此属性.

                I'm adding a UISegmentedControl to the Navigation bar programatically where the titleView should be. But as Apple docs have mentioned under titleView, This property is ignored if leftBarButtonItem is not nil.

                但我也想要返回按钮.就像他们在自己的图片中展示的一样!

                But I want to have the back button as well. Like they have illustrated in their own images!

                下面是我添加UISegmentedControl的代码.

                self.navigationItem.leftBarButtonItem = nil;
                UISegmentedControl *statFilter = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"Filter_Personnal", @"Filter_Department", @"Filter_Company", nil];
                [statFilter setSegmentedControlStyle:UISegmentedControlStyleBar];
                self.navigationItem.titleView = statFilter;
                

                还有其他方法可以添加 UISegmentedControl 以及返回按钮吗?

                Is there another way to add a UISegmentedControl along with the Back button as well?

                谢谢.

                推荐答案

                试试这个

                去掉这一行---> self.navigationItem.leftBarButtonItem = nil;

                改为添加这个

                UISegmentedControl *statFilter = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"Filter_Personnal", @"Filter_Department", @"Filter_Company", nil]];
                [statFilter setSegmentedControlStyle:UISegmentedControlStyleBar];
                [statFilter sizeToFit];
                self.navigationItem.titleView = statFilter;
                

                唯一的改变是我添加了这一行:

                Only change is I have added this line :

                [statFilter sizeToFit];
                

                希望对你有帮助!!!

                这篇关于导航栏中带有返回按钮的 UISegmentedControl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:使用推送在视图中隐藏标签栏 下一篇:无需返回按钮即可推送到 ViewController

                相关文章

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

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

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

                      <bdo id='oIgZZ'></bdo><ul id='oIgZZ'></ul>
                    <tfoot id='oIgZZ'></tfoot>