开发常见报错记录


1、A TaskDescription's primary color should be opaque

翻译—–任务描述:primary color 本应该为不透明的

 <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:windowTranslucentStatus">true</item>
    </style>

就是colorPrimarycolorPrimaryDark的颜色值应该使用6位十六进制数,而不是8位16进制数,如下使用color2就会报错,使用color1就不会,因为color2加上了透明度66

    <color name="color1">#BBBBBB</color>
    <color name="color2">#66BBBBBB</color>

猜你喜欢

转载自blog.csdn.net/m0_37168878/article/details/78872983