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