From e081340665605c54530587cc0cce9bc339585557 Mon Sep 17 00:00:00 2001 From: Vladimir Mutafov Date: Fri, 13 Mar 2020 12:57:38 +0200 Subject: [PATCH] fix: Fix issue for view not being removed from its parent (#8432) --- .../ui/bottom-navigation/bottom-navigation.android.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nativescript-core/ui/bottom-navigation/bottom-navigation.android.ts b/nativescript-core/ui/bottom-navigation/bottom-navigation.android.ts index b59f0414b..ad3671aa5 100644 --- a/nativescript-core/ui/bottom-navigation/bottom-navigation.android.ts +++ b/nativescript-core/ui/bottom-navigation/bottom-navigation.android.ts @@ -107,6 +107,14 @@ function initializeNativeClasses() { this.owner._originalBackground = this.owner.backgroundColor || new Color("White"); this.owner.nativeViewProtected.setBackgroundDrawable(bitmapDrawable); this.backgroundBitmap = null; + + let thisView = this.getView(); + if (thisView) { + let thisViewParent = thisView.getParent(); + if (thisViewParent && thisViewParent instanceof android.view.ViewGroup) { + thisViewParent.removeView(thisView); + } + } } super.onDestroyView();