简体   繁体   中英

How Navigation Controller works - IOS?

I have been working on an IOS application. I got an doubt while working related to Navigation controller. Here is my question. I am pushing all my views into navigation controller when I want a view should appear. I am setting every page its title like..

self.tiltle = @"View1"; // Something like that.

I guess the navigation controller is the same, and view I am loading will only vary, If I am right, why every time the same title is not loading for every page, (If I am not set title like above it comes empty for new view loaded). If I am wrong... Please point it out.

thanks for your valuable suggestion..

Each time you push a UIViewController to a UINavigationController , the navigation controller read's the UIViewController 's self.title or the self.navigationItem.title and displays that on it's navigation bar. If you want to set the same title for all the children view controllers then you have to set self.title on each one of them.

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