You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering a problem with the 'Tab Navigation' template of Nativescript (V4) with Angular, forAndroid, on emulator (Nougat v7.1.1) or on the device (Oreo 8.1).
When I navigate between tabs, the screen "flashes". The behavior seems linked to the use of several "page-router-outlet".
I tried the solution described Nativescript Forum, without success.
With the <item name=“android:windowAnimationStyle”>@null</item> in AppThemeBase, I encounter an error of the type
System.err: com.tns.NativeScriptException:
System.err: Calling js method onViewAttachedToWindow failed
System.err:
System.err: TypeError: Cannot set property 'transitionType' of null
(both on emulator or device).
Hi @jbarnabe@rchougui,
I was able to recreate the issue on my side in a the non-Angular project, and I will mark it as a bug. We will investigate further the case and will provide more info in the issue.
I am also attaching a sample project, which can be used for debugging. Archive.zip
@jbarnabe@tsonevn We have found this issue to be linked to 2 key things in core modules:
For iOS we need a way to set nav bar hidden much earlier and without animation, ie:
constructor(frame: Frame) {
this._controller = UINavigationControllerImpl.initWithOwner(new WeakRef(frame));
// This needs to be set early to avoid white flashes when changing page-router-outlets preferably in the constructor for iOS frame
this._controller.setNavigationBarHiddenAnimated(true, false);
}
We've also found it helps for iOS to set transparent background on the controllers when they are constructed, ie in page.ios.ts where this occurs:
const controller = UIViewControllerImpl.initWithOwner(new WeakRef(this));
this.viewController = this._ios = controller;
// controller.view.backgroundColor = whiteColor; (This is what it's doing now which obviously could cause a white flash)
controller.view.backgroundColor = new Color("#00000000").ios; // instead could ensure transparent to start
Activity
NathanWalker commentedon Oct 25, 2018
@jbarnabe @tsonevn We have found this issue to be linked to 2 key things in core modules:
We've also found it helps for iOS to set transparent background on the controllers when they are constructed, ie in
page.ios.tswhere this occurs:fix(tabview): prevent white flash on tab changes nativescript-angular#1569
jbarnabe commentedon Oct 25, 2018
Hi @NathanWalker, thx, I'm going to try this
jbarnabe commentedon Nov 7, 2018
After migrating to the final version 5.0.0 I no longer have the problem (and without applying the correction proposed by @NathanWalker)
MrToxy commentedon Apr 12, 2019
I'm still experiencing this issue with the latest version. The flash goes away after navigating between tabs a couple of times
tsonevn commentedon Apr 15, 2019
HI @MrToxy,
Can you send us a sample project, which demonstrates the issue, you are facing?
lock commentedon Apr 15, 2020
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.