[英]how to properly create dark theme for android app?
我想創建一個深色主題並完全控制哪些元素獲得哪種顏色。 我in
值(夜間) resource and added some colors and changed
主題(夜間) colors. but when i use
colors. but when i use
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); its seems that none of those defined colors are being used. the
its seems that none of those defined colors are being used. the
某種原因,操作欄```與背景顏色相同,並且我在顏色資源中定義的 colors 都沒有被使用。 我試圖定義自己的主題,但一切都變得一團糟。
創建深色主題並在其中定義自定義 colors 的正確方法是什么?
要在您的應用程序上使用暗模式,您必須在夜間值中創建 styles。 您的應用的夜間主題樣式必須擴展Theme.AppCompat.DayNight.NoActionBar :
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
....
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.