简体   繁体   中英

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. 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. To match what you get with a UINavigationController, you may have to resort to images.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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