ios - Can't set my navigation bar background image -


i want change table view navigation bar background image png, created nav bar png exact sizes of default nav bar (i checked in interface builder).

this code (in table view controller class, viewdidload method):

uinavigationbar *navbar = self.navigationcontroller.navigationbar; uiimage *image = [uiimage imagenamed:@"nav.png"]; [navbar setbackgroundimage:image forbarmetrics:uibarmetricsdefault]; 

shouldn't work..?

this table view settings in interface builder if help:

enter image description here enter image description here

the top 1 suppose , bottom 1 im getting:

enter image description here

thanks!

uiimageview *backimgview = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"nav.png"]]; [self.navigationcontroller.navigationbar addsubview:backimgview]; 

try add image in custom view


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -