Nativescript-Tabview闪烁过渡

时间:2018-10-17 12:01:07

标签: nativescript nativescript-angular

我在模拟器( Nougat v7.1.1 )上遇到了带有Angular的本机(V4)和Angular 的“标签导航”模板的问题,或者在设备上( Oreo 8.1 )。

当我在选项卡之间导航时,屏幕“闪烁”。该行为似乎与使用多个“ page-router-outlet”有关。

我尝试了Nativescript Forum中描述的解决方案,但没有成功。

在AppThemeBase中使用str时,我遇到类型错误

<item name=“android:windowAnimationStyle”>@null</item>

(在仿真器或设备上)。

a little video showing the problem

如果有人有想法? :)

1 个答案:

答案 0 :(得分:0)

我们发现此问题与NativeScript核心模块中的2个关键问题有关:

  • 对于iOS,我们需要一种将导航栏设置为更早隐藏且没有动画的方法,即:

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); }

我们还发现,iOS可以在构造控制器时在控制器上设置透明背景,例如在page.ios.ts中设置透明背景:

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

更多讨论在这里: https://github.com/NativeScript/NativeScript/issues/6454#issuecomment-433176056

相关问题