IOS Hidden status bar

Source: Internet
Author: User

When the system version number is higher than iOS7.0, then the original hidden status bar method may not be good to make. Because if you use the method of modifying plist to implement the hidden method, it still works.

Plist Method:Key:status Bar is initially hidden Value:yes since the program was opened, the status bar has been hidden Key:view controller-based status bar appearance value : YES After entering the program, the status bar is hidden.(that is, the Welcome screen default.png time to display the status bar) Code Method:The disadvantage of the code method is that you cannot hide the status bar of the Welcome screen. Because the Welcome screen is turned on, Appdelegate has not executed didfinishlaunching.The advantage is that you can display the status bar in the specified Viewcontroller, just change the code's Yes to no
1-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchoptions {2     //Override point for customization after application launch.3     if([Uidevice Currentdevice].systemversion.floatvalue <7.0) {4[UIApplication Sharedapplication].statusbarhidden =YES;5     }6     Else if([Self respondstoselector: @selector (setneedsstatusbarappearanceupdate)])7     {8         //iOS7 and above9 [self prefersstatusbarhidden];Ten         //This is the update status bar display state, only support iOS7 and above, using Performselector is to not affect the main thread of other work One [Self performselector: @selector (setneedsstatusbarappearanceupdate)]; A     } -     returnYES; - } the  --(BOOL) Prefersstatusbarhidden - { -     returnYES;//Hide as Yes, show as no +}

IOS Hidden status bar

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.