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:
Alexander Djenkov
2018-04-18 10:47:19 +03:00
committed by GitHub
parent 6fb7481327
commit b9806bad1c
5 changed files with 94 additions and 4 deletions

View File

@@ -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;