简体   繁体   English

导航栏控制器中的自定义后退按钮

[英]Custom back button in Navigation Bar Controller

I customize de back button of navigation controller for make a concret action when push it. 我自定义导航控制器的后退按钮,以在按下按钮时进行具体操作。 I do these: 我做这些:

self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]
                                             initWithTitle:@"Atrás"
                                             style:UIBarButtonItemStyleBordered
                                             target:self
                                             action:@selector(pop)];

Now, I need to put the same back arrow in my custom button because the rest of buttons are default back button. 现在,我需要在自定义按钮中添加相同的后退箭头,因为其余按钮均为默认后退按钮。 Exists any way to do these without images? 存在任何没有图像的方法吗?

If you use a UINavigationController, and push all of your views thru it, you will get the default iOS back button styles. 如果您使用UINavigationController,并通过它推送所有视图,则将获得默认的iOS后退按钮样式。 If you're just using a UINavigationBar that you add to your Views yourself, then it's up to you to create the style of that button. 如果您只是使用自己添加到视图中的UINavigationBar,则由您来创建该按钮的样式。 To match what you get with a UINavigationController, you may have to resort to images. 为了匹配使用UINavigationController获得的功能,您可能必须诉诸图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM