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

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

  2. <small id='yEka0'></small><noframes id='yEka0'>

    <tfoot id='yEka0'></tfoot>

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

      将自定义按钮添加到无边框导航控制器

      时间:2023-06-11

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

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

              <tbody id='xRQqd'></tbody>
            • <bdo id='xRQqd'></bdo><ul id='xRQqd'></ul>
              • <small id='xRQqd'></small><noframes id='xRQqd'>

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

              • 本文介绍了将自定义按钮添加到无边框导航控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我将自定义按钮添加到导航控制器

                <上一页>UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back.png"]样式:UIBarButtonItemStylePlain目标:自己动作:@selector(backAction)];self.navigationItem.leftBarButtonItem = backButton;

                它工作正常,但按钮出现边框.我该如何解决?

                更新我找到了解决方案

                <上一页>UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 25, 25)];[按钮 setImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal];[按钮 addTarget:self action:@selector(buttonFavoriteClicked) forControlEvents:UIControlEventTouchUpInside];UIBarButtonItem *back = [[UIBarButtonItem alloc] initWithCustomView:button];[按钮释放];

                self.navigationItem.leftBarButtonItem = back;

                解决方案

                试试这个.

                UIButton *backButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, button_width, button_height)];[backButton setImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal];[backButton addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];

                I add custom button to navigation controller

                    UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back.png"]
                                                                                   style:UIBarButtonItemStylePlain
                                                                                  target:self
                                                                                  action:@selector(backAction)];
                    self.navigationItem.leftBarButtonItem = backButton;
                

                it works fine, but button appears bordered. How can I fix that?

                UPDATE I found solution

                   
                 UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 25, 25)];
                    [button setImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal];
                    [button addTarget:self action:@selector(buttonFavoriteClicked) forControlEvents:UIControlEventTouchUpInside];
                    UIBarButtonItem *back = [[UIBarButtonItem alloc] initWithCustomView:button];
                    [button release];
                 

                self.navigationItem.leftBarButtonItem = back;
                

                解决方案

                Try this.

                UIButton *backButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, button_width, button_height)];
                [backButton setImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal];
                [backButton addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
                self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
                

                这篇关于将自定义按钮添加到无边框导航控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:没有导航控制器的 pushViewController 下一篇:继承 UINavigationController 的步骤

                相关文章

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

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

                    <legend id='ZnwLB'><style id='ZnwLB'><dir id='ZnwLB'><q id='ZnwLB'></q></dir></style></legend>
                    • <bdo id='ZnwLB'></bdo><ul id='ZnwLB'></ul>