使 UIToolbar 消失
这是一个非常简单的问题,所以我认为我不需要发布代码。我有一个应用程序,当导航控制器推送特定视图时,其中会出现一个工具栏。但是,当我返回到上一个视图时,工具栏仍保留在视图上。我尝试在视图的 viewDidUnload
中调用 [toolbar removeFromSuperview]
以及切换 UIToolbar 的“隐藏”属性,但无济于事。
任何帮助将不胜感激。
This is a pretty straightforward question, so I don't think I need to post code. I have an app in which a toolbar appears when a specific view is pushed by the navigation controller. However, when I go back to the previous view, the toolbar remains on the view. I've tried calling [toolbar removeFromSuperview]
, as well as toggling UIToolbar's "hidden" property, within the view's viewDidUnload
to no avail.
Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
-(void)[UINavigationController setToolbarHidden:(BOOL)hiddenanimated:(BOOL)animated]
在适当的时候调用它。
viewWillAppear:
是一个不错的选择。保留一个标记,表明您认为它应该处于什么状态-(void)[UINavigationController setToolbarHidden:(BOOL)hidden animated:(BOOL)animated]
Call that when appropriate.
viewWillAppear:
is a good choice. keep a flag as to what state you think it should be in