簡體   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