我正在使用Eclipse并遇到麻烦CardView
。
错误:在包中找不到属性'cardCornerRadius'的资源标识符
我已经将最新的android-support-v7-cardview.jar添加到libs文件夹并构建路径。
我的CardView布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".activity.CardViewActivity">
<android.support.v7.widget.CardView
android:layout_width="200dp"
android:layout_height="200dp"
android:id="@+id/cardView"
card_view:cardCornerRadius="6dp"
card_view:cardBackgroundColor="#84ffff">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Test CardView"
android:layout_centerInParent="true"
android:textSize="18sp"
android:textColor="#fff"/>
</RelativeLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
清单中的目标sdk版本也是targetSdkVersion="22"
。
但是我仍然遇到同样的错误。
请不要给我提供Android Studio的示例。它在AS中工作正常。但由于许多原因,我没有使用它。
终于我找到了解决方案。而不是添加.jar文件。您可以将其导入为库。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句