Skip to content

Commit

Permalink
Fix inset issue while searching
Browse files Browse the repository at this point in the history
  • Loading branch information
Kapeli committed Dec 24, 2017
1 parent a8f5589 commit d022d88
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Dash/DHDBSearchController.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ - (void)searchDisplayController:(UISearchDisplayController *)controller didLoadS
{
self.loading = YES;
tableView.allowsSelection = NO;
if(isIOS11)
{
if(@available(iOS 11.0, *))
{
tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
}
[tableView registerNib:[UINib nibWithNibName:@"DHBrowserCell" bundle:nil] forCellReuseIdentifier:@"DHBrowserCell"];
[tableView registerNib:[UINib nibWithNibName:@"DHLoadingCell" bundle:nil] forCellReuseIdentifier:@"DHLoadingCell"];
}
Expand Down
7 changes: 7 additions & 0 deletions Dash/DHRepo.m
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,13 @@ - (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSS

- (void)searchDisplayController:(UISearchDisplayController *)controller didLoadSearchResultsTableView:(UITableView *)tableView
{
if(isIOS11)
{
if(@available(iOS 11.0, *))
{
tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
}
[controller.searchResultsTableView registerNib:[UINib nibWithNibName:@"DHRepoCell" bundle:nil] forCellReuseIdentifier:@"DHRepoCell"];
[controller.searchResultsTableView registerNib:[UINib nibWithNibName:@"DHLoadingCell" bundle:nil] forCellReuseIdentifier:@"DHLoadingCell"];
tableView.allowsSelection = NO;
Expand Down
7 changes: 7 additions & 0 deletions Dash/DHTocBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ - (IBAction)dismissModal:(id)sender
- (void)searchDisplayController:(UISearchDisplayController *)controller didLoadSearchResultsTableView:(UITableView *)tableView
{
self.searchController = controller;
if(isIOS11)
{
if(@available(iOS 11.0, *))
{
tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
}
tableView.rowHeight = 44;
tableView.separatorInset = UIEdgeInsetsMake(0, DHHeaderSeparatorInset, 0, 0);
if(iPad && isRegularHorizontalClass)
Expand Down

0 comments on commit d022d88

Please sign in to comment.