iOS removal of navigation bar and Tabbar 1px horizontal line

Source: Internet
Author: User

1. In your own defined navigation bar or design manuscript often need to remove the navigation bar 1px horizontal line, mainly color is too uncoordinated
Remove the previous picture

To remove this 1px horizontal line, you should first know what it is, in the Xcode interface debugging can be seen, it is actually uiimageview to


Find out what the horizontal line is ...

In fact this is Navigationbar shadowimage, so as long as set it to empty, but set it to empty before you should set its background is also empty, all the code is as follows:

[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];[self.navigationController.navigationBar setShadowImage:[UIImage new]];

The finished effect is as follows (isn't it all right? ):


The effect after completion

Since the horizontal line of the navigation bar can be removed, the Tabbar line can also be removed (in fact, it is shadowimage) ...

Method One:

Custom Uitabbarcontroller

Method Two:
[self.tabBarController.tabBar setBackgroundImage:[UIImage new]];[self.tabBarController.tabBar setShadowImage:[UIImage new]];

Conversely, if we want to customize the color of the horizontal line is also possible, as long as the shadowimage can be set. (If there is a better way, want to exchange a bit ~ ~)



Wen/FU HC (Jane book author)
Original link: http://www.jianshu.com/p/d0f354aa4d0d
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".

iOS removal of navigation bar and Tabbar 1px horizontal line

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.