Adding image to navigation bar

后端 未结 9 2152
一个人的身影
一个人的身影 2020-12-23 02:09

I\'d like an image to take up all of a navigation bar. This is the navigation that comes with a navigation based app. It appears on the RootViewController with the accompa

9条回答
  •  没有蜡笔的小新
    2020-12-23 02:40

    its changed for ios6, to make it work in ios 6 use:

    UINavigationBar *navBar = self.navigationController.navigationBar;
    UIImage *image = [UIImage imageNamed:@"image.png"];
    [navBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];
    

提交回复
热议问题