下にスクロールすると、UISearchBarがTableviewとともに移動しません。
スクロールバーを個別に配置したくありません。その要件。以下はコードです。
customSearchBar = [[UISearchBar alloc] init];
customSearchBar.delegate = self;
[customSearchBar sizeToFit];
objListTable.tableHeaderView = customSearchBar;
下にスクロールすると、UISearchBarがTableviewとともに移動しません。
スクロールバーを個別に配置したくありません。その要件。以下はコードです。
customSearchBar = [[UISearchBar alloc] init];
customSearchBar.delegate = self;
[customSearchBar sizeToFit];
objListTable.tableHeaderView = customSearchBar;
Need to include a View and add UISearchbar on it, or else provide height of the Header view. By default its treats as 0.0.
If you want to use
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
the method allocate a View with height of default UISeachBar
height. and add UISearchBar
on it.
Or else add a UIView
on your code with default UISearchBar
height add UISearchBar
on it. It will works as you expected.