One
The screen origin coordinates (x, y) are subject to Self.navigationcontroller. Navigationbar's settranslucent (BOOL) property controls
After iOS7, the translucent property defaults to Yes for the property meaning is the translucent effect of the frosted glass
YES starting coordinates are (0, 0) at the top left corner of the screen, where the UI is displayed through the navigation bar
No starting coordinates for the top left corner of the screen is (0, 20 + 44) This indicates that the starting coordinates are not frosted glass at the beginning of the navigation bar at the bottom of the status bar and navigation bar.
Second
We know that the navigation controller is the control root of the whole is unified state, so to use the system's navigation controller change style is to change the whole then if you want to customize one of the pages, you must restore the system design state of the navigation bar when exiting the current page
The rest in the actual combat slowly realize extrapolate effect can come out
For example
+(void) Setnormalgreennav: (Uinavigationcontroller *) navigationcontroller{[Navigationcontroller.navigationbar Settranslucent:no]; if(Floor (Nsfoundationversionnumber) <=Nsfoundationversionnumber_ios_6_1) {[Navigationcontroller.navigationbar settintcolor:[uicolor colorwithred:0.25Green0.65Blue0.35Alpha1]]; [Navigationcontroller.navigationbar setbackgroundimage:[uiimage imagenamed:@"Header.png"] Forbarmetrics:uibarmetricsdefault]; } Else{[Navigationcontroller.navigationbar setbackgroundimage:nil forbarmetrics:uibarmetricsdefault]; [Navigationcontroller.navigationbar Settintcolor:[uicolor Whitecolor]; //navigation bar text color [Navigationcontroller.navigationbar Setbartintcolor:color_theme_green]; //navigation bar background color }}+(void) Cancelnormalgreennav: (Uinavigationcontroller *) navigationcontroller{[Navigationcontroller.navigationbar Settranslucent:yes]; [Navigationcontroller.navigationbar setbackgroundimage:[uiimage imagenamed: @ "header_newblack2" ] Forbarmetrics:uibarmetricsdefault]; //This is a translucent picture }
Its three
Bug Analysis above method overall style is green navigation non-frosted glass effect which occasionally appears transparent frosted glass effect this time if the start coordinate height change when switching 0--(20 + 44) There will be a black horizontal bar over the visual UI this I handled this by adding a UI delay of about 0.8 seconds to avoid seeing this black horizontal bar
IOS screen origin coordinates && navigation bar style customization