机器人包括标签 - 无效的布局参考 [英] android include tag - invalid layout reference

查看:107
本文介绍了机器人包括标签 - 无效的布局参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有包括不同的布局通过包括在android布局的xml文件标签的问题。当specifing布局参考(@layout / ...),我越来越在Eclipse ADT与下面的错误InflateException: InflateException:必须specifiy有效的布局参考。布局ID @布局/ func_edit_simple_calculator_toolbox是无效的。

I'm having a problem including a different layout through the include tag in the android layout xml file. When specifing the layout reference ( @layout/... ), i'm getting a InflateException in the Eclipse ADT with the following error: InflateException: You must specifiy a valid layout reference. The layout ID @layout/func_edit_simple_calculator_toolbox is not valid.

基准应该是有效的,因为我选择了它从我的其他布局,并没有这类型的列表中。我正在使用Android SDK中2.1

the reference should be valid, as I've selected it from the the list of my other layouts and didnt type it in. I'm using android sdk v2.1

这些都是布局文件

func_edit_simple_calculator_toolbox.xml

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

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>

有没有人知道可能是什么问题?

Does any one know what could be the problem?

在此先感谢

推荐答案

我想我应该提到我是如何解决同样的问题。试图清理项目,并没有工作。我有相当大的名称布局(chrono_first_small_field),这是不是原因要么。

I think i should mention how i solved the same problem. Tried cleaning the project and didn't work. I have quite large names for the layout (chrono_first_small_field), and that wasn't the cause either.

封闭的Eclipse,只是再次打开它,并且工作。

这更有意义不必实现onMeasure方法: - )

That makes more sense than having to implement the onMeasure method :-)

这篇关于机器人包括标签 - 无效的布局参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆