1. <tfoot id='3uMPQ'></tfoot>

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

        <small id='3uMPQ'></small><noframes id='3uMPQ'>

        在 Iphone SDK 的导航栏上添加多个按钮

        时间:2023-06-12
          <tbody id='FrMPo'></tbody>

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

            • <small id='FrMPo'></small><noframes id='FrMPo'>

              • <bdo id='FrMPo'></bdo><ul id='FrMPo'></ul>
                <i id='FrMPo'><tr id='FrMPo'><dt id='FrMPo'><q id='FrMPo'><span id='FrMPo'><b id='FrMPo'><form id='FrMPo'><ins id='FrMPo'></ins><ul id='FrMPo'></ul><sub id='FrMPo'></sub></form><legend id='FrMPo'></legend><bdo id='FrMPo'><pre id='FrMPo'><center id='FrMPo'></center></pre></bdo></b><th id='FrMPo'></th></span></q></dt></tr></i><div id='FrMPo'><tfoot id='FrMPo'></tfoot><dl id='FrMPo'><fieldset id='FrMPo'></fieldset></dl></div>
                • 本文介绍了在 Iphone SDK 的导航栏上添加多个按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想将两个带有自定义图像的按钮添加到具有特定位置的导航栏.

                  I want to add two buttons with custom image to Navigation Bar with some specific position.

                  我找到了解决方案,但它适用于右/左导航栏按钮.

                  I found solution But it is for Right/Left Navigation Bar Button.

                  我的代码是:

                   NSMutableArray *buttons = [[NSMutableArray alloc] initWithCapacity:2];
                   UIToolbar *tools = [[UIToolbar alloc]
                                      initWithFrame:CGRectMake(0.0f, 0.0f, 90.0f, 55.01f)];
                  // Add Pin button.
                  
                  UIBarButtonItem *bi1 = [[UIBarButtonItem alloc] initWithTitle:@"Edit" style:UIBarButtonItemStylePlain target:self action:@selector(Edit:)];
                  bi1.style = UIBarButtonItemStyleBordered;
                  bi1.width = 45;
                  [buttons addObject:bi1];
                  [bi1 release];
                  
                  // Add Hot Spot button.
                  UIBarButtonItem *bi2 = [[UIBarButtonItem alloc] initWithTitle:@"+" style:UIBarButtonItemStylePlain target:self action:@selector(Add:)];
                  bi2.style = UIBarButtonItemStyleBordered;
                  [buttons addObject:bi2];
                  [bi2 release];
                  
                  // Add buttons to toolbar and toolbar to nav bar.
                  [tools setItems:buttons animated:NO];
                  [buttons release];
                  
                   // Add toolbar to nav bar.
                  UIBarButtonItem *twoButtons = [[UIBarButtonItem alloc] initWithCustomView:tools];
                  [tools release];
                  self.navigationItem.rightBarButtonItem = twoButtons;
                  [twoButtons release];
                  

                  我该怎么做?

                  推荐答案

                  UIView *vieww =[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
                  [vieww addSubview:yourBtn1];
                  [vieww addSubview:yourBtn2];
                  
                  [self.navigationController.navigationBar addSubview:vieww];    
                  

                  如果你想删除 yourButtonView 那么 make 是全局对象;

                  And if you want to remove yourButtonView then make is global object;

                  in .h
                  
                  UIView *vieww;
                  

                  并在 .m

                  -(void)viewWillDisappear:(BOOL)animated
                  {
                      [vieww removeFromSuperview];
                  }
                  

                  或关注更多链接

                  这篇关于在 Iphone SDK 的导航栏上添加多个按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何使用情节提要 ID 显示各种视图控制器(每个都有其各自的导航控制器) 下一篇:UINavigationController 并呈现一个模态控制器

                  相关文章

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

                      <tfoot id='LrN2C'></tfoot>

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