如何在按下按鈕時使我的UINavigationController
顯示提示?我已經把我的文字由[[[self navigationController]navigationItem]setPrompt:[NSString stringWithFormat:@"Prompt is working!"]];
導航控制器顯示提示
編輯: 爲了澄清,我有一個按鈕調用一個IBAction
,設置提示如下,但我需要找到一種方法,只要該按鈕被按下時顯示提示:
-(IBAction)test:(id)sender
{
[[[self navigationController]navigationItem]setPrompt:[NSString stringWithFormat:@"Prompt works!"]];
//I want it to display right after I set it, so I'm missing something and can't figure it out through the documentation
}
我已經嘗試[[[self navigationController]navigationBar]pushNavigationItem:nav animated:YES];
但拋出一個錯誤,說明Cannot call pushNavigationItem:animated: directly on a UINavigationBar managed by a controller.
您應該發佈更多的代碼。問題是什麼,按鈕? –
何時顯示提示? –
我希望它在用戶按下按鈕時顯示。 – Baub