Hide gray lines at the bottom of the navigation bar

Source: Internet
Author: User

The problems encountered in the work, refer to the online information (http://blog.it985.com/9808.html). There are three methods, the first method is to change the background of the navigation bar, the second approach is to traverse the navigation bar sub-control, find the hidden bottom gray line, the third is through the xib to achieve, the controller's navigation bar with the general Control (UIView) to create, Instead, hide the navigation bar in the Viewdidload: method.

The drawback of method one and method three is that the translucent effect of the navigation bar disappears.

By default, there is a gray line below the navigation bar.

Specific implementations of three methods:

Method One: Set the navigation bar of Beijing pictures and shadow pictures

Run results

This method is the official method, the flaw of this method is that the translucency of the navigation bar will be removed without the transparency effect.

Method Two: Traverse the navigation bar sub-control, find and hide the bottom gray line

Implementation ideas: (1) in the Viewdidload: method to traverse the navigation bar of the child control, look for the bottom gray Line control, found and stored in the property variable.

(2) Hide the gray line in the Viewwillappear: method.

(3) The gray line is displayed in the Viewwilldisappear: method.

This method handles the navigation bar after throwing a transparent effect.

Method Three: Customize the navigation bar directly in the xib.

Implementation ideas: (1) Use the control to create your own navigation bar in Xib.

(2) Hide the navigation bar in the Viewdidload method.

The navigation bar, which is processed by this method, also loses the transparency effect.

Hide gray lines at the bottom of the navigation bar

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.