ksg*_*rkn 8 android android-theme android-styles
我试图使用android黑暗主题。我安装了android studio 3.5预览版。
compileSdkVersion 28目标SdkVersion 28
但仍然出现此错误。这是黑暗主题错误还是我做错了什么?
build.gradle{
dependencies {
// ...
implementation 'com.google.android.material:material:1.1.0-alpha06'
// ...
}}
Run Code Online (Sandbox Code Playgroud)
styles.xml
<style name="Theme.MyApp" parent="Theme.MaterialComponents.DayNight">
<item name="android:forceDarkAllowed">true</item>
</style>
Run Code Online (Sandbox Code Playgroud)
项目链接
您需要compiledSdkVersion在应用程序build.gradle中将其增加到29个:
android {
compileSdkVersion 29
defaultConfig {
minSdkVersion 21
targetSdkVersion 29
...
}
Run Code Online (Sandbox Code Playgroud)
那你应该很好走!
| 归档时间: |
|
| 查看次数: |
3255 次 |
| 最近记录: |