Bau*_*aub 3 iphone objective-c uinavigationcontroller
如何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
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试[[[self navigationController]navigationBar]pushNavigationItem:nav animated:YES];
但是会引发错误说明Cannot call pushNavigationItem:animated: directly on a UINavigationBar managed by a controller.
Ahm*_*dal 21
您应该像这样设置提示文本:
self.navigationItem.prompt = @"This is the title";
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5904 次 |
最近记录: |