Android 在另一个项目中引用图像

Android 在另一个项目中引用图像,android,Android,我有一个项目,我把我所有的图像系统在工作区。 我把这个放在我的布局的顶部 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:images="http://schemas.android.com/apk/res/com.utas.android.imagelibrary" android:orientation="vertical" android:layout

我有一个项目,我把我所有的图像系统在工作区。 我把这个放在我的布局的顶部

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:images="http://schemas.android.com/apk/res/com.utas.android.imagelibrary"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/dark_blue"
    android:padding="8dip"
    >

名称空间“images”在Eclipse中给出了一个警告,指出“未使用的名称空间images”,这让我相信我至少在这一部分做对了,但下一部分是错的

在ImageLibrary中(在同一工作区中选中了“Is Library”复选框的项目),我有以下路径 res/drawable/01_core\u accept/drawable hdpi/ic\u action\u acept.png

我在布局中有一个按钮,如下所示

<Button
    android:id="@+id/btn_finish_a"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:text="@string/btn_finish_a_label"
    android:layout_toRightOf="@id/btn_start_c"
    android:icon="@images:res/drawable/01_core_accept/drawable-hdpi/ic_action_acept"
    android:onClick="finishActivityA"
    />

但是,我在图像引用中遇到一个错误,说明“错误:错误:找不到与给定名称匹配的资源(在'icon'处,值为'@images:res/drawable/01_core\u accept/drawable hdpi/ic\u action\u acept')。”


如何正确引用外部图像?

您不需要这一行:

xmlns:images="http://schemas.android.com/apk/res/com.utas.android.imagelibrary"
该行应为:

android:icon="@drawable/ic_action_acept"

如果您正确链接了Android库项目,则该库中定义的资源应编译到您的应用程序中,并且您引用的方式与您自己的res文件夹中的资源相同。

我想我很快就会与您联系。在我运行应用程序之前,编译器确实删除了错误。换句话说,改变它并保存它,就像它看到了资源一样。但当我运行它时,错误返回。相同的错误,但只是新的位置。有什么想法吗?