status bar, navigation bar, navigation controller related property settings and other considerations

Source: Internet
Author: User

July 08, 2015

1, for the IOS6 navigation bar background picture is 44 @2x to be designed to 88

2, for the IOS7 navigation bar background picture is 64 @2x to be designed to 128

The reasons for the above differences are due to the IOS6 inside, the status bar 20 is not included in the navigation bar, and IOS7 is included in the navigation bar.

3. Modify the text color of the status bar (global modification)

1. First in the Info.plist file, first add a view controller-based status bar appearance option and set to NO.

2. This can be used

Set the color of the status bar

[[UIApplication sharedapplication] setstatusbarstyle:uistatusbarstylelightcontent];

In this way, the color of the status bar can be set globally, and it is suitable for the agent.

4, set the navigation bar various properties

    //set the theme of the navigation barUinavigationbar *navbar = [Uinavigationbar appearance];//get the look of the navigation bar[NavBar setbackgroundimage:[uiimage imagenamed:@"NavBar64"] Forbarmetrics:uibarmetricsdefault];        [NavBar Settintcolor:[uicolor Whitecolor]; Nsmutabledictionary*attrs =[Nsmutabledictionary dictionary]; Attrs[uitextattributetextcolor]=[Uicolor Whitecolor]; Attrs[uitextattfile:///Users/dsw/Desktop/screen shot%202015-07-08%2020.48.02.pngRibutetextshadowcolor]=[Uicolor Blackcolor];
    // set the navigation bar properties, passing in a dictionary

5, get the information of the equipment

For example: [Uidevice currentdevice].systemversion Gets the system version number of the device

6, if you click on a button to jump to another page, you need to modify the original style of the system, the method is: intercept the Push method, set in the inside, namely: Define a navigation controller and inherit from the system's own navigation controller

, override this push method to intercept all push operations

-(void) Pushviewcontroller: (Uiviewcontroller *) Viewcontroller animated: (BOOL) animated{       Note: here to be super before the call, or super execution, the controller has jumped, do not see the effect    of hidden Tabbar viewcontroller.hidesbottombarwhenpushed = YES;    [Super Pushviewcontroller:viewcontroller Animated:yes];}

Extension: As long as the system method is not enough, you can use this method (inheritance, rewrite), so that you can modify any system comes with the function. Pay attention to this idea.

7. All controllers are called by a method.

+ (void) initialize

This method is only the first time the controller load will be called, want to create a navigation controller for the appropriate, you can put some global settings in this method, do not need to re-set each time.

8, like IOS6 system sometimes when the program starts, you need to hide the status bar, wait until the program starts to display the status bar, this time set as follows:

1. Check the Hide Settus bar inside so that the status bar will disappear when you start

2. When the program starts,

-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (nsdictionary *) launchOptions set to: Application.statusbarhidden = NO;

Can

9, the program icon after loading, the default will have a layer of glow effect, remove the method:

You can hook it up in the middle of the line.

In Xcode4, however, you need to add the icon already includes gloss effects in the plist file and set the property to YES to set

status bar, navigation bar, navigation controller related property settings and other considerations

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.