Status Bar-iOS development

Source: Internet
Author: User

The status bar can be modified through some methods provided by the uiapplication class, such as removing the status bar completely or modifying the style, but these changes are only within your program, when you exit your program, it recovers again.

UIApplication *myApp = [UIapplication sharedApplication];

1. Hide the status bar

[myApp setStatusBarHidden:YES animated:YES];

Remember to increase the size of your "desktop" after hiding the status bar by 320 × 20, so it is best to hide it before any windows or view is created.

2. Status Bar Style

[myApp setStatusBarStyle: UIStatusbarStyleBlackOpaque];
typedef enum {        UIStatusBarStyleDefault,        UIStatusBarStyleBlackTranslucent,        UIStatusBarStyleBlackOpaque    } UIStatusBarStyle;

3. Status Bar direction

[myApp setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft animated:NO];
Typedef Enum {uiinterfaceorientationportrait = uideviceorientationportrait, // portrait screen, vertical up margin = landscape, // portrait screen, vertical up and down reverse uiinterfaceorientationlandscapeleft = uideviceorientationlandscaperight, // The device rotates counterclockwise to the Landscape mode. uiinterfaceorientationlandscaperight = uideviceorientationlandscapeleft // The device rotates clockwise to the Landscape mode.} uiinterfaceorientation;

Related Article

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.