2012-10-21 20 views

回答

2

如果您在UINavigationController小號正確使用視圖控制器,那麼你只需要設置視圖的標題:

self.title = @"Title"; 

通過它的聲音,你手動放置導航欄在視圖,這意味着你需要掌握實例,並自己修改其中的文本。

// Set a "tag" to the Navigation Bar, in Interface Builder or via code (navigationBat.tag = 200;) 
UINavigationBar* bar = [self.view viewWithTag:200]; 
bar.title = @"Title"; 

爲了在正確的位置執行此操作,您需要在選擇表格視圖行時執行此操作。您需要設置爲表視圖的代表。

self.tableView.delegate = self; 

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    ... 
    self.title = @"Title"; // Or whatever mode you're using to set the title 
} 
+0

謝謝你,我試試 –

+0

@Avirok如果這符合你的需求,你能否接受答案?謝謝 – WDUK

相關問題