0
如何在分割視圖項目中更改彈出窗口上的標題?它目前在分割視圖項目中說「Root View Controller」?ipad彈出窗口中的SplitView標題
如何在分割視圖項目中更改彈出窗口上的標題?它目前在分割視圖項目中說「Root View Controller」?ipad彈出窗口中的SplitView標題
如果你不介意有相同的標題時,它也是在橫向模式下(不彈出),然後在RootViewController
的viewDidLoad
方法,你可以這樣做:
self.title = @"Title Here";
或IB:
willHideViewController
添加代碼輸入新的標題
如果你想在景觀一個標題,另一個用於彈出,是可以做的,並willShowViewController
委託方法。在標準拆分視圖模板中,這些在DetailViewController
中實現。
的代碼是(假設左側視圖控制器是一個導航控制器就像在模板):
//in willHideViewController:
((UINavigationController *)aViewController).topViewController.title
= @"Title For Popup Mode";
//in willShowViewController:
((UINavigationController *)aViewController).topViewController.title
= @"Title For Landscape Mode";
謝謝,真是棒極了! – lascoff