Skip to content

Commit

Permalink
Fixed a blank question at the bottom of searchSuggestionView on iOS 11
Browse files Browse the repository at this point in the history
Fixed a blank question at the bottom of searchSuggestionView on iOS 11
  • Loading branch information
ko1o committed Nov 16, 2017
1 parent feb193c commit 6f5e48e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions PYSearch/PYSearchSuggestionViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ - (void)setSearchSuggestions:(NSArray<NSString *> *)searchSuggestions
self.tableView.contentInset = self.originalContentInsetWhenKeyboardHidden;
}
self.tableView.contentOffset = CGPointMake(0, -self.tableView.contentInset.top);

if (@available(iOS 11.0, *)) {
self.tableView.contentInset = UIEdgeInsetsMake(-30, 0, 0, 0);
}
}

#pragma mark - Table view data source
Expand Down
1 change: 1 addition & 0 deletions PYSearch/PYSearchViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ - (void)setup
[cancleButton setTitle:[NSBundle py_localizedStringForKey:PYSearchCancelButtonText] forState:UIControlStateNormal];
[cancleButton addTarget:self action:@selector(cancelDidClick) forControlEvents:UIControlEventTouchUpInside];
[cancleButton sizeToFit];
cancleButton.py_width += PYSEARCH_MARGIN;
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:cancleButton];
/**
* Initialize settings
Expand Down

0 comments on commit 6f5e48e

Please sign in to comment.