22import { ItemEventData } from "." ;
33import {
44 ListViewBase , View , KeyedTemplate , Length , Observable , Color ,
5- separatorColorProperty , itemTemplatesProperty , layout , EventData
5+ separatorColorProperty , itemTemplatesProperty , iosEstimatedRowHeightProperty , layout , EventData
66} from "./list-view-common" ;
77import { StackLayout } from "../layouts/stack-layout" ;
88import { ProxyViewContainer } from "../proxy-view-container" ;
@@ -138,7 +138,7 @@ class UITableViewDelegateImpl extends NSObject implements UITableViewDelegate {
138138 public tableViewHeightForRowAtIndexPath ( tableView : UITableView , indexPath : NSIndexPath ) : number {
139139 const owner = this . _owner . get ( ) ;
140140 if ( ! owner ) {
141- return DEFAULT_HEIGHT ;
141+ return tableView . estimatedRowHeight ;
142142 }
143143
144144 let height : number ;
@@ -188,7 +188,7 @@ class UITableViewRowHeightDelegateImpl extends NSObject implements UITableViewDe
188188 }
189189 return indexPath ;
190190 }
191-
191+
192192 public tableViewDidSelectRowAtIndexPath ( tableView : UITableView , indexPath : NSIndexPath ) : NSIndexPath {
193193 tableView . deselectRowAtIndexPathAnimated ( indexPath , true ) ;
194194
@@ -198,7 +198,7 @@ class UITableViewRowHeightDelegateImpl extends NSObject implements UITableViewDe
198198 public tableViewHeightForRowAtIndexPath ( tableView : UITableView , indexPath : NSIndexPath ) : number {
199199 let owner = this . _owner . get ( ) ;
200200 if ( ! owner ) {
201- return DEFAULT_HEIGHT ;
201+ return tableView . estimatedRowHeight ;
202202 }
203203
204204 return owner . _effectiveRowHeight ;
@@ -345,7 +345,7 @@ export class ListView extends ListViewBase {
345345 return height ;
346346 }
347347
348- return DEFAULT_HEIGHT ;
348+ return this . _ios . estimatedRowHeight ;
349349 }
350350
351351 public _prepareCell ( cell : ListViewCell , indexPath : NSIndexPath ) : number {
@@ -428,4 +428,13 @@ export class ListView extends ListViewBase {
428428
429429 this . refresh ( ) ;
430430 }
431+
432+ [ iosEstimatedRowHeightProperty . getDefault ] ( ) : Length {
433+ return DEFAULT_HEIGHT ;
434+ }
435+ [ iosEstimatedRowHeightProperty . setNative ] ( value : Length ) {
436+ const nativeView = this . _ios ;
437+ const estimatedHeight = Length . toDevicePixels ( value , 0 ) ;
438+ nativeView . estimatedRowHeight = estimatedHeight < 0 ? DEFAULT_HEIGHT : estimatedHeight ;
439+ }
431440}
0 commit comments