【发布时间】:2012-06-27 16:30:48
【问题描述】:
我目前使用这段代码来设置我的导航项的titleView:
- (void)viewDidLoad
{ ...
UIImage *navbarTitle = [UIImage imageNamed:@"navbartitleview1"];
UIImageView *imageView = [[UIImageView alloc]initWithImage:navbarTitle];
self.navigationItem.titleView =imageView;
}
有没有办法可以使用 UIAppearance 放置此代码?
[UINavigationItem appearance]
无效。
【问题讨论】:
-
简单地说,不。如果您正在查看头文件,则必须使用 UI_APPEARANCE_SELECTOR 标记属性。 UINavigationItem 也不符合 UIAppearance 协议。
-
啊,原来如此,谢谢。
标签: ios uinavigationitem uiappearance titleview