iOS Settings Uinavigationbar style

Source: Internet
Author: User

To facilitate the demonstration, I built a basic navigation bar with storyboard and got the Navgationbar in the code.

Uinavigationbar *bar = Self.navigationController.navigationBar;

1

[Bar Settintcolor:[uicolor Whitecolor];

Set navigation bar title color

123 [
Bar settitletextattributes:@{                                  nsforegroundcolorattributename: [Uicolor Whitecolor]                                  }];

If you need to set the color of the return button, set the Tintcolor of bar


Set Uinavigationbar background picture

?
1 [bar setBackgroundImage:[UIImage imageNamed:@"bg.png"] forBarMetrics:UIBarMetricsDefault];
?
1


Set Uinavigationbar full transparency, set a picture here casually, it is important that the Barmetrics property determines the bar style

?
1 [bar setBackgroundImage:[UIImage imageNamed:@"bg.png"] forBarMetrics:UIBarMetricsCompact];
?
1


The navigation bar has no transparency when the content is not displayed under the navigation bar

?
1 self.extendedLayoutIncludesOpaqueBars = YES;
?
1
Using storyboard requires setting in the controller



That's what happens when you're done, but the bar's tintcolor will be the color of the content below.

Also set in the scrolling view

The Automaticallyadjustsscrollviewinsets property controls whether scrolling content is displayed below bar.

iOS Settings Uinavigationbar style

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.