Java android.view.InflateException:二进制XML文件行#1:膨胀类linearlayout时出错
我使用以下代码创建带有复选框的对话框,如下所示: 创建: checbox.xml的布局:Java android.view.InflateException:二进制XML文件行#1:膨胀类linearlayout时出错,java,android,android-layout,layout,Java,Android,Android Layout,Layout,我使用以下代码创建带有复选框的对话框,如下所示: 创建: checbox.xml的布局: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout_root" android:orientation="horizontal" android:layout_height="fill_parent" android:padding="1
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root" android:orientation="horizontal"
android:layout_height="fill_parent"
android:padding="10dp">
<CheckBox
android:text="Do not show again"
android:id="@+id/skip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
</CheckBox>
</LinearLayout>
有一个嵌套的“起因”异常,它将为您提供更具体的失败原因
但请注意你的资本化。没有linearlayout
,但有linearlayout
。这同样适用于复选框
另外,您的
LinearLayout
将需要layout\u width
Make您忘了在checkbox.xmlpost中为您的LinearLayout指定宽度您完成了日志吗?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root" android:orientation="horizontal"
android:layout_height="fill_parent"
android:padding="10dp">
<CheckBox
android:text="Do not show again"
android:id="@+id/skip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
</CheckBox>
</LinearLayout>