Skip to content

Commit

Permalink
fix(ios): expose "sectionHeaderTopPadding" for layout backwards compa…
Browse files Browse the repository at this point in the history
…tibility (#13021)
  • Loading branch information
hansemannn authored Aug 20, 2021
1 parent 17ce706 commit 934c440
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apidoc/Titanium/UI/ListView.yml
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,14 @@ properties:
type: Number
permission: read-only

- name: sectionHeaderTopPadding
summary: Padding above each section header.
description: If not set or set to `-1`, it defaults to an automatic spacing determined by the system.
type: Number
since: 10.1.0
platforms: [iphone, ipad, macos]
osver: { ios: { min: "15.0" } }

- name: showVerticalScrollIndicator
summary: Determines whether this list view displays a vertical scroll indicator.
description: Set to `false` to hide the vertical scroll indicator.
Expand Down
8 changes: 8 additions & 0 deletions apidoc/Titanium/UI/TableView.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1459,6 +1459,14 @@ properties:
since: { android: 3.1.0, iphone: 3.0.0, ipad: 3.0.0 }
platforms: [android, iphone, ipad, macos]

- name: sectionHeaderTopPadding
summary: Padding above each section header.
description: If not set or set to `-1`, it defaults to an automatic spacing determined by the system.
type: Number
since: 10.1.0
platforms: [iphone, ipad, macos]
osver: { ios: { min: "15.0" } }

- name: separatorColor
summary: Separator line color between rows, as a color name or hex triplet.
description: |
Expand Down
11 changes: 11 additions & 0 deletions iphone/Classes/TiUIListView.m
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,17 @@ - (void)setDisableBounce_:(id)value
[[self tableView] setBounces:![TiUtils boolValue:value def:NO]];
}

#if IS_SDK_IOS_15
- (void)setSectionHeaderTopPadding_:(id)value
{
if (![TiUtils isIOSVersionOrGreater:@"15.0"]) {
return;
}

self.tableView.sectionHeaderTopPadding = [TiUtils floatValue:value def:UITableViewAutomaticDimension];
}
#endif

- (void)setAllowsMultipleSelectionDuringEditing_:(id)value
{
ENSURE_TYPE(value, NSNumber);
Expand Down
11 changes: 11 additions & 0 deletions iphone/Classes/TiUITableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -1821,6 +1821,17 @@ - (void)setSearch_:(id)search
}
}

#if IS_SDK_IOS_15
- (void)setSectionHeaderTopPadding_:(id)value
{
if (![TiUtils isIOSVersionOrGreater:@"15.0"]) {
return;
}

self.tableView.sectionHeaderTopPadding = [TiUtils floatValue:value def:UITableViewAutomaticDimension];
}
#endif

- (void)initSearhController
{
if (searchController == nil) {
Expand Down

0 comments on commit 934c440

Please sign in to comment.