From 365d48550f9550334fad736caad26f941adc3752 Mon Sep 17 00:00:00 2001 From: Hristo Hristov Date: Tue, 12 Dec 2017 16:47:25 +0200 Subject: [PATCH] Revert Page.android onContentChange to addViewToNativeVisualTre due to Angular issue with ProxyViewContainer --- tns-core-modules/ui/page/page.android.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tns-core-modules/ui/page/page.android.ts b/tns-core-modules/ui/page/page.android.ts index a1e506f2f..6d7a257f8 100644 --- a/tns-core-modules/ui/page/page.android.ts +++ b/tns-core-modules/ui/page/page.android.ts @@ -25,11 +25,20 @@ export class Page extends PageBase { this.nativeViewProtected.setBackgroundColor(-1); // White color. } - public _onContentChanged(oldView: View, newView: View) { - super._onContentChanged(oldView, newView); - if (newView) { - GridLayout.setRow(newView, 1); + public _addViewToNativeVisualTree(child: View, atIndex?: number): boolean { + // Set the row property for the child + if (this.nativeViewProtected && child.nativeViewProtected) { + if (child instanceof ActionBar) { + GridLayout.setRow(child, 0); + child.horizontalAlignment = "stretch"; + child.verticalAlignment = "top"; + } + else { + GridLayout.setRow(child, 1); + } } + + return super._addViewToNativeVisualTree(child, atIndex); } @profile