【问题标题】:Show/Hide UINavigationBar with animated screen move like in UISearchBar使用 UISearchBar 中的动画屏幕移动显示/隐藏 UINavigationBar
【发布时间】:2011-09-16 07:03:03
【问题描述】:

我在屏幕上有 UITextView,在它上面有 UINavigationBar。 我怎样才能达到触摸 UISearchBar 时的效果。有可能吗?

【问题讨论】:

  • 你能告诉我你到底想要什么..?

标签: iphone objective-c xcode uinavigationbar


【解决方案1】:

里面几乎有一个UISearchBar -(void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar 您可以使用 [navigationController setNavigationBarHidden: YES animated:YES] 动画,当您在搜索栏内单击时将其隐藏,然后在 - (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar 内您将使用 [navigationController setNavigationBarHidden: NO animated:YES] 动画它返回到视图中。

UITextView's Delegate 中,您会得到两个基本相同的方法。

- (void)textViewDidBeginEditing:(UITextView *)textView

你会放在哪里 [navigationController setNavigationBarHidden: YES animated:YES]

- (void)textViewDidEndEditing:(UITextView *)textView

你会放在哪里 [navigationController setNavigationBarHidden: NO animated:YES]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-25
    • 2016-02-02
    相关资源
    最近更新 更多