如何以编程方式删除 UINavigationbar 提示?

问题描述:

我有一个视图控制器,我在 IB 中设置了带有提示的导航栏.但有时我想删除提示并将栏设为1 行".我怎样才能在代码中做到这一点?

I have a view controller, and I set the navigation bar with prompt in IB. But I want to remove the prompt and make the bar as "1 line" sometimes. how can I do it in code?

[[self navigationItem] setPrompt: nil];

这将动画删除提示.