繁体   English   中英

如何防止Android中页面转换之间出现白屏?

[英]How can I prevent white screen between page transitions in Android?

我注意到我的Android版Xamarin.Forms应用暂时在页面转换之间显示白屏。 在启动时和页面加载之间,我想知道在Xamarin.Forms中处理这种情况的最佳方法是什么?

我在资源样式中尝试了这些设置,但没有运气:

<style name="AppDefaultTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowDisablePreview">true</item>
  </style>

在我的清单中:

<application 
android:label="App" 
android:icon="@drawable/AppIcon" 
android:theme="@style/AppDefaultTheme">

以前遇到过这个人吗? 你最好的方法是什么?

有一篇关于Xamarin.Android页面转换的文章:

http://cyrilmottier.com/2013/01/23/android-app-launching-made-gorgeous/

我最好的方法是将Xamarin MVVM方式与Splash Screen和MainLauncher Activity颜色结合使用:

<style name="Theme.Splash" parent="android:Theme">
     <item name="android:windowBackground">@drawable/splash</item>
     <item name="android:windowNoTitle">true</item>
</style>

#FFFFFF

<style name="AppMainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="android:windowBackground">@color/AppBackgroundColor</item>
</style>

而对于MVVM Xamarin的方式,我指的是首先显示你可以显示的最简单的UI和显示加载指示器,让用户知道在你执行异步/等待来自ws或者其他东西的调用时,后台正在发生什么事情花时间,看看Slack app作为例子:

Slack App

这就是您的页面转换将如何最小化并为您的应用创建更稳定的用户体验。

您也可以按照这个Jason Smith技术创建更快的UI:

http://kent-boogaart.com/blog/jason-smith's-xamarin-forms-performance-tips

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM