When you use a function
-(void) SetBackgroundImage: (Nullable UIImage *) backgroundimage forbarmetrics: (uibarmetrics) Barmetrics
When setting the background picture for the navigation bar, if the incoming picture is not processed, it will cause the problem of horizontal repetition of the picture in 6 and 6s (in case the picture itself is not wide enough)
Workaround: Process the incoming picture, using the UIImage function
-(UIImage *) Resizableimagewithcapinsets: (uiedgeinsets) capinsets Resizingmode: (uiimageresizingmode) ResizingMode
Examples:
UIImage *bgimage = [[UIImage imagenamed:@ "Cei_bg_header"] resizableimagewithcapinsets:uiedgeinsetsmake (0, 0, 0, 0) Resizingmode:uiimageresizingmodestretch]; [[Uinavigationbar appearance] Setbackgroundimage:bgimage Forbarmetrics:uibarmetricsdefault];
Reference: Http://stackoverflow.com/questions/26052454/ios-8-navigationbar-backgroundimage
IOS-Change Navigationbar background picture-picture horizontal repetition problem