I have an app with tab bar controller (with 4 views controller) and it contains a navigation controller. All of this was create programmatically. My question: Is there a way how to set one navigation bar title for all view controllers ? For example: When i switch tabs, title is the same. Ideal solution for me is set title in app delegate file. Thanks a lot
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- ios7 new pan gesture to go back in navigation stac
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Can not export audiofiles via “open in:” from Voic
If you know that there will be exactly 4 views controller, just do
self.title = @"your title";
If you want to change "your title" once and have them all changed, just create a static global or use plist. And put the code underviewDidAppear
so that it refreshes every time. No need to do anything too complex :)You can create a very basic subclass of
UIViewController
and set its title. Then, just have your otherUIViewController
subclasses inherit from this base class instead of directly fromUIViewController
.For all of you, I think you want to put a log there, and it is to set an image file as the tab bar sub view and set the heights of the view controllers less the tab bar image as
Try something like this (i don't have access to Xcode atm so please debug it first):