是否有最低的Android版本要求来访问此颜色或什么?我需要将对象的背景颜色设置为'默认'背景颜色,'?android:colorBackground'在我的Nexus 5(Android 5.1.1)上运行良好,但它会崩溃我的笔记。使用“?android:colorBackground”作为颜色在Galaxy Note 3(4.4.2)上崩溃我的应用程序,但不是Nexus
我有一个名为绘制editor_border.xml如下:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- content background -->
<item>
<shape>
<solid android:color="?android:colorBackground" />
<corners android:radius="2dp" />
</shape>
</item>
</layer-list>
我用这个绘制作为背景的布局。当充气的布局,我有如下因素错误”
10-07 22:23:52.634: E/AndroidRuntime(6512): android.view.InflateException: Binary XML file line #11: Error inflating class <unknown>
应用程序崩溃进一步回落
10-07 22:23:52.634: E/AndroidRuntime(6512): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-v4/editor_border.xml from drawable resource ID #0x7f020005
10-07 22:23:52.634: E/AndroidRuntime(6512): Caused by: java.lang.UnsupportedOperationException: Can't convert to color: type=0x2
删除颜色或将其更改为任何其他颜色正常工作。
张贴错误的logcat的。它在哪里崩溃?少量代码会有帮助 –
完成 - 提供更多详细信息 – Prodigga