mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(list-view-ios): fix rowHeight property to apply proper item size for iOS (#5693)
* fix(list-view-ios): fix rowHeight property to apply proper item size for iOS * chore(apps-tests): add rowHeight tests
This commit is contained in:
committed by
GitHub
parent
6fb7481327
commit
b9806bad1c
@@ -197,7 +197,7 @@ class UITableViewRowHeightDelegateImpl extends NSObject implements UITableViewDe
|
||||
return tableView.estimatedRowHeight;
|
||||
}
|
||||
|
||||
return owner._effectiveRowHeight;
|
||||
return layout.toDeviceIndependentPixels(owner._effectiveRowHeight);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,8 +281,8 @@ export class ListView extends ListViewBase {
|
||||
}
|
||||
}
|
||||
|
||||
public isItemAtIndexVisible( itemIndex: number ): boolean {
|
||||
const indexes: NSIndexPath[] = Array.from(this._ios.indexPathsForVisibleRows);
|
||||
public isItemAtIndexVisible(itemIndex: number): boolean {
|
||||
const indexes: NSIndexPath[] = Array.from(this._ios.indexPathsForVisibleRows);
|
||||
return indexes.some(visIndex => visIndex.row === itemIndex);
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ export class ListView extends ListViewBase {
|
||||
}
|
||||
|
||||
public _onRowHeightPropertyChanged(oldValue: Length, newValue: Length) {
|
||||
const value = this._effectiveRowHeight;
|
||||
const value = layout.toDeviceIndependentPixels(this._effectiveRowHeight);
|
||||
const nativeView = this._ios;
|
||||
if (value < 0) {
|
||||
nativeView.rowHeight = UITableViewAutomaticDimension;
|
||||
|
||||
Reference in New Issue
Block a user