My UINavigationitem's TitleView getting expanded in ios 6

前端 未结 2 602
隐瞒了意图╮
隐瞒了意图╮ 2021-01-19 09:58

In my app I have applied an image on uinavigation item. It is running fine in iOS 5 but getting expanded on iOS 6. I have no left or right bar button item in navigation bar.

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-19 10:01

    I have the following code in my project, and works fine under iOS 5 and iOS 6. Can you try this:

    self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"topNav-logo.png"]];
    

    Also, be sure to have both @2x and regular sizes of the image.

提交回复
热议问题