ios - Different UINavigatonBar buttons/title for viewcontrollers inside UITabBarController -
i'm working on application utilizes uitabbarcontroller embedded in uinavigationcontroller (w/ 3 children view controllers).
i want each of these child vc's display different things on navigation bars (different titleviews, buttons, etc), yik yak's interface (those vc's in tab bar controller well):
right now, navigation bar isn't functioning correctly between switching tabs, instead each time switch between tabs, presented view controllers nav bar settings override previous 1 (if hasn't been set yet). if has, displays current nav bar settings.
abstractly, app structure this:
uinavigationcontroller -> uitabbarcontroller -> uiviewcontroller #1 -> uiviewcontroller #2 -> uiviewcontroller #3
i setting each view controller's nav bar settings in viewdidload
example:
- (void)viewdidload { self.tabbarcontroller.navigationitem.titleview = _segmentedcontrol; self.tabbarcontroller.navigationitem.titleview.tintcolor = flatblue; }
what should change desired effect? set navigation bar settings in different place? embed each child vc in uinavigationcontroller?
would love help, couldn't find sources anywhere!
thanks
as mentioned in comments, solution switch nav bar setup , logic from:
viewdidload
to
viewwillappear
Comments
Post a Comment