Java 如何在回收器视图中实现重叠的卡片视图?
基本上我需要的是重叠视图 每个cardview都是一个项目,将包含在recyclerview中 这就是我的卡片视图的定义方式Java 如何在回收器视图中实现重叠的卡片视图?,java,android,Java,Android,基本上我需要的是重叠视图 每个cardview都是一个项目,将包含在recyclerview中 这就是我的卡片视图的定义方式 <RelativeLayout android:layout_width="match_parent" android:layout_height="70dp" android:layout_marginTop="-11dp"> <ScrollView android:layout_width="wra
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginTop="-11dp">
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="none"
android:layout_centerInParent="true"
android:layout_alignParentBottom="true"
>
<android.support.v7.widget.CardView...>
</ScrollView>
<ImageView
android:layout_width="70dp"
android:layout_height="40dp"
android:src="@drawable/img_food_little"
android:layout_alignParentEnd="true"
android:layout_marginEnd="40dp"
/>
</RelativeLayout>
请帮助尝试用cardview替换下面的线性布局,并将生成的布局用作recyclerview项目的布局
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@android:color/transparent"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_gravity="top"
android:layout_marginTop="20dp"
android:background="#cccccc"
android:layout_height="100dp">
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:src="@mipmap/ic_launcher"
android:layout_gravity="right"
android:layout_marginRight="20dp"
android:layout_height="wrap_content" />
</FrameLayout>
希望这有帮助。请同时发布卡片查看代码