在Eclipse中添加外部库

时间:2014-08-12 21:51:36

标签: android

我正在尝试使用此库https://github.com/lopspower/CircularImageView,我将其添加到我的日食中,如此处所示http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject

当我复制库使用中提到的xml时,我得到了这个

Multiple annotations found at this line:
    - error: No resource identifier found for attribute 'border_color' in package 
     'com.mikhaellopez.circularimageviewsample'
    - error: No resource identifier found for attribute 'shadow' in package 
     'com.mikhaellopez.circularimageviewsample'
    - error: No resource identifier found for attribute 'border' in package 'com.mikhaellopez.circularimageviewsample'
    - error: No resource identifier found for attribute 'border_width' in package 
     'com.mikhaellopez.circularimageviewsample'

这是我的XML,

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res/com.mikhaellopez.circularimageview"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="${relativePackage}.${activityClass}" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" />

    <com.mikhaellopez.circularimageview.CircularImageView
        android:layout_width="250dp"
        android:layout_height="250dp"
        android:src="@drawable/image"
        app:border="true"
        app:border_color="@color/GrayLight"
        app:border_width="4dp"
        app:shadow="true" />

</RelativeLayout>

我做错了什么?

1 个答案:

答案 0 :(得分:1)

试试这个我们的xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="${relativePackage}.${activityClass}" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" />

    <com.mikhaellopez.circularimageview.CircularImageView
        android:layout_width="250dp"
        android:layout_height="250dp"
        android:src="@drawable/image"
        app:border="true"
        app:border_color="@color/GrayLight"
        app:border_width="4dp"
        app:shadow="true" />

你知道吗,我改变了这个:

 xmlns:app="http://schemas.android.com/apk/res/com.mikhaellopez.circularimageview"

到此:

 xmlns:app="http://schemas.android.com/apk/res-auto"