Skip to content

Commit

Permalink
fix(ios): top section disappearing in grouped ListView
Browse files Browse the repository at this point in the history
Fixes TIMOB-28109
  • Loading branch information
jquick-axway authored and ewanharris committed Jun 17, 2021
1 parent 3bd1b4e commit 4101958
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions iphone/Classes/TiUIListView.m
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ - (void)updateSearchControllerFrames
if (isSearchBarInNavigation) {
dimmingView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
} else {
dimmingView.frame = CGRectMake(0, searchController.searchBar.frame.size.height, self.frame.size.width, self.frame.size.height - searchController.searchBar.frame.size.height);
dimmingView.frame = CGRectMake(0, self.safeAreaInsets.top + searchController.searchBar.frame.size.height, self.frame.size.width, self.frame.size.height - searchController.searchBar.frame.size.height);
CGPoint convertedOrigin = [self.superview convertPoint:self.frame.origin toView:searchControllerPresenter.view];

UIView *searchSuperView = [searchController.view superview];
Expand Down Expand Up @@ -1749,6 +1749,11 @@ - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSIntege
if (size < DEFAULT_SECTION_HEADERFOOTER_HEIGHT) {
size += DEFAULT_SECTION_HEADERFOOTER_HEIGHT;
}
} else if (0 == section) {
// Make sure grouped style always shows the 1st header if it contains no text/view.
if ((tableView.style == UITableViewStyleGrouped) || (tableView.style == UITableViewStyleInsetGrouped)) {
size = 35.0;
}
}
return size;
}
Expand Down Expand Up @@ -2414,7 +2419,7 @@ - (void)handleTap:(UITapGestureRecognizer *)tapGestureRecognizer
- (void)createDimmingView
{
if (dimmingView == nil) {
dimmingView = [[UIView alloc] initWithFrame:CGRectMake(0, searchController.searchBar.frame.size.height, self.frame.size.width, self.frame.size.height - searchController.searchBar.frame.size.height)];
dimmingView = [[UIView alloc] initWithFrame:CGRectMake(0, self.safeAreaInsets.top + searchController.searchBar.frame.size.height, self.frame.size.width, self.frame.size.height - searchController.searchBar.frame.size.height)];
dimmingView.backgroundColor = [UIColor blackColor];
dimmingView.alpha = .2;
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissSearchController)];
Expand All @@ -2428,7 +2433,7 @@ - (void)showDimmingView
if (isSearchBarInNavigation) {
dimmingView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
} else {
dimmingView.frame = CGRectMake(0, searchController.searchBar.frame.size.height, self.frame.size.width, self.frame.size.height - searchController.searchBar.frame.size.height);
dimmingView.frame = CGRectMake(0, self.safeAreaInsets.top + searchController.searchBar.frame.size.height, self.frame.size.width, self.frame.size.height - searchController.searchBar.frame.size.height);
}
if (!dimmingView.superview) {
[self addSubview:dimmingView];
Expand Down

0 comments on commit 4101958

Please sign in to comment.