简体   繁体   中英

Navigation Controller, Navigation Item and Navigation Bar

I have a view controller. I choose Editor->Embed In->Navigation Controller option. A navigation controller is added to storyboard and my view controller becomes root view controller. Besides, A Navigation Item is added at the top of my view controller.

On the other hand, we can put a navigation bar on view controllers and we can create forward backward transition between view controllers without navigation controller.

What is difference between navigation item and navigation bar ?

The navigation item manages the buttons (left and right) and views (mainly the title view) to be displayed in a navigation bar. Each navigation item points to a specific view controller.

The navigation bar is the container for the navigation item and mainly handles layout, transitions and animations.

You can read more about them in the official docs:

https://developer.apple.com/documentation/uikit/uinavigationitem

https://developer.apple.com/documentation/uikit/uinavigationbar

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