【发布时间】:2011-09-16 07:03:03
【问题描述】:
我在屏幕上有 UITextView,在它上面有 UINavigationBar。 我怎样才能达到触摸 UISearchBar 时的效果。有可能吗?
【问题讨论】:
-
你能告诉我你到底想要什么..?
标签: iphone objective-c xcode uinavigationbar
我在屏幕上有 UITextView,在它上面有 UINavigationBar。 我怎样才能达到触摸 UISearchBar 时的效果。有可能吗?
【问题讨论】:
标签: iphone objective-c xcode uinavigationbar
里面几乎有一个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]
【讨论】: