How to make UIView hides in UITableView as UISearchBar
So... We have UITableView. If we add UISearchBar to the top of UITableView than we will have search bar, that can be hidden by scrolling our table (even if table is empty) and it's working out of box
I'd like to add UIView instead of Search bar and have the same behavior. The questions is how it's working? What method/property does that?
在你的viewWillAppear:
方法中,只需添加self.tableView.contentOffset = CGPointMake(0, myView.frame.size.height);
this is not an easy subject. You should create a UIScrollView and inside it your view (at the top) and your tableView. But a tableView is another ScrollView (ScrollView is the father than tableView), and you need switch between them in order one receive the drag event or the other. In all WWDC Videos, there is a video about scrollView, in the last you can find one than explain how to do this.
链接地址: http://www.djcxy.com/p/55972.html