android.view.InflateException 二進制 XML 文件第 0 行:錯誤導致類膨脹:java.lang.reflect.InvocationTargetException員工布局.xml 文件<?xml version="1.0" encoding="utf-8"?><android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" app:cardElevation="10dp" app:cardBackgroundColor="@color/cardview_light_background" > <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?android:backgroundSplit" android:padding="10dp" > <TextView android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/name" android:textColor="@android:color/black" android:textSize="15sp" android:textStyle="bold"/> <TextView android:id="@+id/type" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/type" android:textColor="@android:color/black" android:textSize="15sp" android:textStyle="normal"/> </LinearLayout></android.support.v7.widget.CardView>
1 回答

神不在的星期二
TA貢獻1963條經驗 獲得超6個贊
android.R.attr.backgroundSplit用于拆分 ActionBar(在布局底部顯示額外的按鈕等)。它確實定義了背景,但根據文檔,它可以引用任何類型的資源、任何類型的主題,甚至只是一個直接的十六進制顏色字符串。
LinearLayout 的背景字段只能采用顏色、顏色參考或可繪制參考。
添加回答
舉報
0/150
提交
取消