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:
the top 1 suppose , bottom 1 im getting:
thanks!
uiimageview *backimgview = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"nav.png"]]; [self.navigationcontroller.navigationbar addsubview:backimgview];
try add image in custom view
Comments
Post a Comment