diff --git a/tns-core-modules/ui/list-view/list-view.android.ts b/tns-core-modules/ui/list-view/list-view.android.ts index 85832436d..9209a9614 100644 --- a/tns-core-modules/ui/list-view/list-view.android.ts +++ b/tns-core-modules/ui/list-view/list-view.android.ts @@ -56,13 +56,10 @@ export class ListView extends ListViewBase { const listView = new android.widget.ListView(this._context); listView.setDescendantFocusability(android.view.ViewGroup.FOCUS_AFTER_DESCENDANTS); - this.updateEffectiveRowHeight(); // Fixes issue with black random black items when scrolling listView.setCacheColorHint(android.graphics.Color.TRANSPARENT); - // listView.setId(this._androidViewId); - ensureListViewAdapterClass(); const adapter = new ListViewAdapterClass(this); listView.setAdapter(adapter); @@ -77,6 +74,8 @@ export class ListView extends ListViewBase { public initNativeView(): void { super.initNativeView(); + this.updateEffectiveRowHeight(); + const nativeView: any = this.nativeViewProtected; (nativeView).itemClickListener.owner = this; const adapter = (nativeView).adapter; @@ -97,6 +96,12 @@ export class ListView extends ListViewBase { super.disposeNativeView(); } + public onLoaded() { + super.onLoaded(); + // Without this call itemClick won't be fired... :( + this.requestLayout(); + } + public refresh() { const nativeView = this.nativeViewProtected; if (!nativeView || !nativeView.getAdapter()) {