diff --git a/apps/app/ui-tests-app/list-view/main-page.ts b/apps/app/ui-tests-app/list-view/main-page.ts index eaae1317f..195ee96ed 100644 --- a/apps/app/ui-tests-app/list-view/main-page.ts +++ b/apps/app/ui-tests-app/list-view/main-page.ts @@ -17,6 +17,7 @@ export function loadExamples() { examples.set("listview-bg-separator-color", "list-view/listview-bg-separator-color"); examples.set("csslv", "list-view/csslv"); examples.set("scrolling-and-sizing", "list-view/scrolling-and-sizing"); + examples.set("row-height", "list-view/row-height"); return examples; } diff --git a/apps/app/ui-tests-app/list-view/row-height.css b/apps/app/ui-tests-app/list-view/row-height.css new file mode 100644 index 000000000..1c81851e7 --- /dev/null +++ b/apps/app/ui-tests-app/list-view/row-height.css @@ -0,0 +1,51 @@ +.p-10 { + padding: 10 20 10 20; +} + +.m-b-10 { + margin-bottom: 10; +} + +.page { + background-color: #F2F2F2; +} + +ListView { + background-color: yellow; +} + +TextView { + background-color: #FFF; +} + +.bordered { + border-width: 5; + border-color: green; +} + +.fixed-height { + height: 55; +} + +.border-radius { + border-radius: 15; +} + +.border-radius-nonuniform { + border-radius: 10 20 30 40; +} + +.bordered-nonuniform { + border-top-color: red; + border-right-color: green; + border-bottom-color: blue; + border-left-color: purple; + border-top-width: 5; + border-right-width: 10; + border-bottom-width: 15; + border-left-width: 20; +} + +.body { + font-size: 11; +} \ No newline at end of file diff --git a/apps/app/ui-tests-app/list-view/row-height.ts b/apps/app/ui-tests-app/list-view/row-height.ts new file mode 100644 index 000000000..162ff3015 --- /dev/null +++ b/apps/app/ui-tests-app/list-view/row-height.ts @@ -0,0 +1,4 @@ +export function onNavigatingTo(args) { + const page = args.object; + page.bindingContext = ["Item 1", "Item 2", "Item 3"]; +} \ No newline at end of file diff --git a/apps/app/ui-tests-app/list-view/row-height.xml b/apps/app/ui-tests-app/list-view/row-height.xml new file mode 100644 index 000000000..fdf617605 --- /dev/null +++ b/apps/app/ui-tests-app/list-view/row-height.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tns-core-modules/ui/list-view/list-view.ios.ts b/tns-core-modules/ui/list-view/list-view.ios.ts index 93949ea5f..dbe4a97fe 100644 --- a/tns-core-modules/ui/list-view/list-view.ios.ts +++ b/tns-core-modules/ui/list-view/list-view.ios.ts @@ -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;