Concept: The so-called Uinavigationitem can be understood as navigation bar content, by editing the Uinavigationitem, we can make in navigation bar to display the things you want, such as setting the title, add a button
Navigationitem and Uinaviagationcontroller-lateral,
1. Navigationbar has many properties: such as Barstyle, background backgroundcolor, frame properties (which can be obtained by wide-height information)
2. You can set the background picture through the SetBackgroundImage method and use the Clipstobounds cropping
Navigationbar's Hidden
This needs to be controlled by his dad Self.navigationcontroller. Set Navigationbarhidden directly set TRUE or False
Settings for Navigationitem
1. Set title. Self.navigationItem.title =
2. Set Titleview
3. Set the left and right side buttons
Self. Navigationitem. Leftbarbuttonitem
Self.navigationItem.leftBarButtonItems
Uistatusbar
Control the display of StatusBar
If you replace the return value, you need to call the Setneedsstatusbarappearanceupdate method @IBAction Func gggg (_ Sender:anyobject) { h =!h } var h = False { didset{ //Setneedsstatusbarappearanceupdate () uiview.animate (withduration: 0.25, animations: { self.setneedsstatusbarappearanceupdate ()}} }} var style: Uistatusbarstyle = Uistatusbarstyle.default override var preferredstatusbarstyle:uistatusbarstyle { get{ return style } } override var prefersstatusbarhidden:bool { get{ return h } }
After IOS Viewcontroller started using full-screen layouts, and the default behavior involved edgesforextendedlayout. Specifies the direction to which the edge is to be stretched, and its default value is naturally Uirectedgeall, extending from the surrounding edges. Even if there are navigationbar in the view and there are Tabbar, the view will still extend to the area of four weeks.
OS7 and above have been changed, the Uitabbar class has added a translucent property, and the translucent property in the Uinavigationbar class is also modified by default to Yes. This means that the two bar is used by default, which shows a translucent effect that blurs what is obscured by bar. This can lead to problems such as color chromatic aberration and the starting point of the Xib file control we will be following.
Navigation Bar and Status bar settings