我想要使用标准标签栏项目与自定义标题。我在TabBarItem直接创建后更改标题self.tabBarItem.title = @“喜欢”。例如“收藏夹” - UITabBarSystemItemFavorites:如何更改默认标题的UITabBarItem
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.title = NSLocalizedString(@"Liked", @"Liked");
self.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:0];
self.tabBarItem.title = @"Liked";
}
return self;
}
我可以这样做吗?如果是的话,我犯了什么错误?
UPD:更改标签栏项目标题在viewDidLoad中()作品上的iOS4,但在iOS5中不起作用。是否存在另一种方法?
感谢
你能解决这个问题吗? – newenglander