但这就是我所得到的:
这是我的colors.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#ffff</color>
<color name="colorPrimaryDark">#2a68c4</color>
<color name="colorAccent">#ffff</color>
<color name="colorBlueTransparent">#803e4ca7</color>
</resources>
这是activity_background.xml:
<?xml version="1.0" encoding="utf-8" ?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="0"
android:endColor="#8000ffff"
android:startColor="#4590ff" />
</shape>
styles.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@drawable/activity_background</item>
<item name="android:textColorPrimaryInverse">@color/colorPrimary</item>
<item name="android:textColorSecondaryInverse">@color/colorPrimary</item>
<item name="android:colorBackground">@color/colorPrimary</item>
<item name="android:colorForeground">@color/colorPrimary</item>
<item name="android:textColorPrimary">@color/colorPrimary</item>
<item name="android:textColorSecondary">@color/colorPrimary</item>
</style>
<style name="DefaultFontStyle" parent="android:Widget.Holo.Button">
<item name="android:fontFamily">sans-serif-light</item>
</style>
</resources>
我在清单中引用了主题。 在Android Studio设计器中,它看起来没问题(因为我有Windows 10 ...无法运行模拟器),但是在LG G2 mini上测试它,4.4.2,Moto G和5.1,给我上面的图像。 我敢打赌这与样式在该版本中的表现有关,但我还没有发现它是什么。