Navigation Bar and Status bar settings

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.