我正在做一個專案,我想擁有自定義啟影片面,但我也想擁有與我的 Android 主題選擇相對應的深色風格的 Android 對話框。
目前一切似乎都很好,除了我的日期選擇器有我的閃屏背景。如何保持初始螢屏不變,但使用自定義顏色作為日期選擇器背景而不是當前的初始螢屏影像?同樣出于某種原因,我的其他對話框在按鈕中有藍色文本,但日期選擇器全是紫色的。為什么會這樣以及如何解決?
這是我在 Android 專案中的 styles.xml:
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MainTheme.Splash" parent="MainTheme.Base">
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowIsFloating">false</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="colorPrimary">#2196F3</item>
<item name="colorAccent">#1976D2</item>
</style>
</resources>
目前,如果我有這個:<item name="android:windowBackground">@drawable/splash_screen</item>
->我的日期選擇器背景是閃屏影像
如果我洗掉<item name="android:windowBackground">@drawable/splash_screen</item>
-> 我的啟影片面沒有影像,只有深色背景
我的目標是在日期選擇器中使用深色背景,并在初始螢屏中使用影像。
uj5u.com熱心網友回復:
如果有人想知道的話,這是一個答案:
<style name="MainTheme" parent="MainTheme.Base">
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowIsFloating">false</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="colorPrimary">#2196F3</item>
<item name="colorAccent">#1976D2</item>
<item name="android:datePickerDialogTheme">@style/CustomDatePickerDialog</item>
</style>
<style name="CustomDatePickerDialog" parent="ThemeOverlay.AppCompat.Dialog">
<!--header background-->
<item name="colorAccent">#009933</item>
<!--header textcolor-->
<item name="android:textColorPrimaryInverse">#ff9900</item>
<!--body background-->
<item name="android:windowBackground">#000099</item>
<!--selected day-->
<item name="android:colorControlActivated">#ff8000</item>
<!--days of the month-->
<item name="android:textColorPrimary">#ffff00</item>
<!--days of the week-->
<item name="android:textColorSecondary">#ff0066</item>
<!--cancel&ok-->
<item name="android:textColor">#00ffff</item>
</style>
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/480365.html
標籤:C# xamarin xamarin.forms xamarin.android
上一篇:如何在所有頁面上為我的HttpClient設定授權標頭?
下一篇:已安裝的apk無法啟動
