Skip to content

Commit a5184cf

Browse files
ozonelmyzoomchan-cxj
authored andcommitted
fix(ios): reset tableview top padding to zero in ios15 (#1000)
fix(ios): reset tableview top padding to zero in ios15
1 parent e2faa1d commit a5184cf

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/ios.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ on:
2424

2525
jobs:
2626
buildios:
27-
runs-on: macOS-latest
27+
runs-on: macOS-11
2828
steps:
2929
- uses: actions/checkout@v2
3030
- name: buildexample
31-
run: pushd examples/ios-demo && xcodebuild build -destination 'name=iPhone 11' -scheme 'HippyDemo' && popd
31+
run: |
32+
# https://github.com/actions/virtual-environments/issues/4180
33+
# Xcode_13 will be selected on October, 18, so we need to set to xcode13 manually before that day.
34+
sudo xcode-select --switch '/Applications/Xcode_13.0.app/'
35+
pushd examples/ios-demo && xcodebuild build -destination 'name=iPhone 11' -scheme 'HippyDemo' && popd

ios/sdk/component/listview/HippyBaseListView.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ - (void)initTableView {
8585
_tableView.allowsSelection = NO;
8686
_tableView.estimatedRowHeight = 0;
8787
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
88+
if (@available(iOS 15.0, *)) {
89+
[_tableView setSectionHeaderTopPadding:0.0f];
90+
}
8891
if (@available(iOS 11.0, *)) {
8992
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
9093
_tableView.insetsContentViewsToSafeArea = NO;

0 commit comments

Comments
 (0)