使用android:color=";时膨胀类时出错;?android:colorBackground“;
此可绘制图形可创建斜切背景:使用android:color=";时膨胀类时出错;?android:colorBackground“;,android,android-studio,background-color,Android,Android Studio,Background Color,此可绘制图形可创建斜切背景: <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/colorPrimary"/> <item android:top="170dp" android:bottom="-100dp" android:left="0dp"
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/colorPrimary"/>
<item android:top="170dp"
android:bottom="-100dp"
android:left="0dp"
android:right="-300dp">
<rotate
android:fromDegrees="-10"
android:pivotX="0%"
android:pivotY="100%">
<shape
android:shape="rectangle">
<solid
android:color="?android:colorBackground"/>
</shape>
</rotate>
</item>
</layer-list>
在Android Studio中,视图可以工作,但在RUN
之后,它在移动设备上不工作
错误日志:
android.view.InflateException
:二进制XML文件行#9:膨胀类时出错
如何修复它?您在XML drawables中使用的主题引用需要API级别21(当前最小值低于21)我发现了相同的问题,我通过传递颜色代码而不是
android:color=“?android:colorBackground”
并且为我工作了…没有办法在棒棒糖前的设备上引用XML drawable中的主题/样式属性,重复的可能重复的你能帮我更多吗?
<solid
android:color="#FFFFFF"/>