我開發一個應用程序,我作出瞭如下佈局:如何使CardView通過CardView?請參閱細節
有一個CircleImageView
和CardView
。
這裏的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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.playrapp.playr.Profile"
tools:showIn="@layout/activity_profile">
<android.support.v7.widget.CardView
android:id="@+id/profileCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:contentPadding="10dp">
</android.support.v7.widget.CardView>
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/userImageProfile"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginTop="50dp"
android:src="@mipmap/ic_launcher"
android:layout_centerHorizontal="true"/>
</RelativeLayout>
這裏,cardview是在ImageView的。我希望imageview能夠通過cardview。我怎樣才能做到這一點?
請讓我知道。
包裝在一個虛擬的LinearLayout –