[英]Prevent TablewViewHeader to show when [tableView reloadData] is performed
does anyone know if there is a way to prevent my table view header to show (in this case a UISearchBar ) when a [tableView reloadData]
is performed. 有谁知道当执行[tableView reloadData]
时是否有一种方法可以防止我的表视图标头显示(在这种情况下为UISearchBar )。
I want to avoid this behaviour. 我想避免这种行为。 The only way to show the search bar is when the user scrolls down the table. 显示搜索栏的唯一方法是当用户向下滚动表格时。
Thanks 谢谢
After [tableView reloadData];
在[tableView reloadData];
Setting content offset(y position) of tableView might help. 设置tableView的内容偏移(y位置)可能会有所帮助。
CGFloat nSearchBarHeight = 40;
CGPoint point = (CGPoint){0,nSearchBarHeight};
tableView.contentOffset = point;
Hope that helps. 希望能有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.