eclipse 使用cardview控件时配置命名空间的方法和Android_Studio不一样
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="${relativePackage}.${activityClass}"
xmlns:app="http://schemas.android.com/apk/res/com.gome.mycardview">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_centerInParent="true"
app:cardCornerRadius="20dp"
android:background="#00ff00" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="我是CardView"
android:textColor="#fff000" />
</android.support.v7.widget.CardView>
</RelativeLayout>
如以上代码中xmlns:app="http://schemas.android.com/apk/res/com.gome.mycardview" 其中come.gome.mycardview为xml文件对应的包名
app:cardCornerRadius为cardview的圆角半径