0
我已經將導航欄拖到故事板中的我的UITableViewController的頂部。在viewDidLoad
我想更新導航控制器中的標題,但[self [email protected]"New Title"];
不起作用。編輯導航欄的組件
我已經將導航欄拖到故事板中的我的UITableViewController的頂部。在viewDidLoad
我想更新導航控制器中的標題,但[self [email protected]"New Title"];
不起作用。編輯導航欄的組件
你可以試試這個:
IBOutlet UINavigationItem* barItem = /*(the bar your want to change in storyboard)*/;
barItem.title = @"new title";
如果你想改變它,用barItem.title = ...
或self.navigationItem.title = ...
你必須確保視圖控制器(self
)從UINavigationController
繼承。
我使用'@property(strong,nonatomic)IBOutlet UINavigationItem * bar'將UINavigationbar鏈接到我的頭文件。然而在'[_bar.title = @「newTitle」]的實現文件中;'xcode是說它缺少一個標識符。 – rmp2150 2014-09-23 01:53:38