About Navgaitionbar Black Line

Source: Internet
Author: User

1, the origin of the black line

To make it easier for developers to set the navigation bar background for the user, the default is to give the navigation bar a layer, which is imageview, and then set the ShadowImage for the ImageView, which leads to the black line we see in the navigation bar.

2, how to remove

Method 1:

Since it is shadowImage, you can set the background picture first, then set the ShadowImage.

[[Uinavigationbar appearance]SetBackgroundImage:[[UIImage alloc] init] forbarposition:uibarpositionany Barmetrics:uibarmetricsdefault];[[ Uinavigationbar appearance]    setshadowimage:[[UIImage alloc] [init]];

Method 2:
Set the Clipstobounds property of the Uinavigationbar to Yes.

Method 3:
Loop through all of the Uinavigationbar's sub-views and find the Uiimageview type of view removed or set to hidden (hidden).
Although it can achieve the desired effect, this method is not too smart and too violent, not very recommended.





About Navgaitionbar Black 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.