我有一个问题,包括一个不同的布局通过包含标签在android布局xml文件。当指定布局引用(@layout / …)时,我得到一个InflateException在Eclipse ADT与以下错误:
InflateException:您必须指定有效的布局引用。布局ID @ layout / func_edit_simple_calculator_toolBox无效。
InflateException:您必须指定有效的布局引用。布局ID @ layout / func_edit_simple_calculator_toolBox无效。
引用应该是有效的,因为我从我的其他布局的列表中选择它,并没有输入它。我使用的是android sdk v2.1
这些是布局文件
func_edit_simple_calculator_toolBox.xml
<?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="wrap_content"> <TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content"android:layout_height="wrap_content"> <Button android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1"></Button> <Button android:id="@+id/Button02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="2"></Button> <Button android:id="@+id/Button03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="3"></Button> <Button android:id="@+id/Button04" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="+"></Button> </TableRow> <TableRow android:id="@+id/TableRow02" android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:id="@+id/Button05" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="4"></Button> <Button android:id="@+id/Button06" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="5"></Button> <Button android:id="@+id/Button07" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="6"></Button> <Button android:id="@+id/Button08" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="-"></Button> </TableRow> </TableLayout>
function_editor_layout.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <com.calculoid.FunctionView android:id="@+id/function_view" android:layout_width="fill_parent" android:layout_height="fill_parent"/> <include android:id="@+id/include01" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/func_edit_simple_calculator_toolBox"></include> </LinearLayout>
有没有人知道可能是什么问题?
提前致谢
我想我应该提及我如何解决同样的问题。试图清理项目,没有工作。我有相当大的名称为布局(chrono_first_small_field),这不是原因。
关闭Eclipse,并再次打开它,这工作。
这比要实现onMeasure方法更有意义:-)
原文地址:https://www.jb51.cc/xml/293865.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。