1: Navigation bar
Change status bar, but need to add field View controller-based status bar appearance = = NO default Yes
[UIApplication sharedapplication].statusbarstyle = uistatusbarstylelightcontent;
1. Set the color of the navigation bar
Self.navigationController.navigationBar.barTintColor = [Uicolor Redcolor];
2. Turn off the frosted glass effect on the navigation bar.
Self.navigationController.navigationBar.translucent = YES;
3. Hide the navigation bar
Self.navigationController.navigationBar.hidden = NO;
4. Set the render color of the navigation bar content
Self.navigationController.navigationBar.tintColor = [Uicolor Purplecolor];
5. Set the background picture of the navigation bar.
The picture size is different, the effect of the display is not the same; (must be very strict)
[Self.navigationController.navigationBar setbackgroundimage:<# (UIImage *) #> forbarmetrics:<# ( Uibarmetrics) #>];
6. Set the size and color of the title text of the navigation bar
Nsdictionary *dic = @{nsfontattributename:[uifont boldsystemfontofsize:18], Nsforegroundcolorat Tributename:[uicolor Redcolor]};
Self.navigationController.navigationBar.titleTextAttributes = dic;
2:
/**
* Customize the navigation bar content individually for the current interface
*/
-(void) Customizednavigationbarcontent {
Configure the caption that appears on the navigation bar
Self.navigationItem.title = @ "First interface";
Configure the title view of the navigation bar
Uisegmentedcontrol *segment = [[Uisegmentedcontrol alloc] initwithitems:@[@ "Country", @ "region"];
Self.navigationItem.titleView = segment;
Configure left content, Show Trash button
Uibarbuttonitem *leftitem = [[Uibarbuttonitem alloc] Initwithbarbuttonsystemitem:uibarbuttonsystemitemtrash target: Self action: @selector (Handletrash:)]; Self.navigationItem.leftBarButtonItem = Leftitem;
Configure the right content
Uibarbuttonitem *rightitem = [[Uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemadd target: Self action: @selector (Handleadd:)];
Self.navigationItem.rightBarButtonItem = Rightitem;
}
/**
*//When setting the Navigationbar, such as adding a scrollview, the system will automatically move the ScrollView down from the top 64 pixels, in order to avoid this, we have two ways:
1. Turn off the navigationbar effect of the wool glass;
2. Automaticallyadjustsscrollviewinsets the Navigationbar property = NO;
iOS navigation bar configuration issues