Android 如何像tinder一样实现卡片堆栈UI?

Android 如何像tinder一样实现卡片堆栈UI?,android,android-cardview,swipe-gesture,Android,Android Cardview,Swipe Gesture,我无法为卡片堆栈实现正确的UI 请检查这张照片,这是我必须尽快满足的要求 我也用过,但UI不符合要求,我也尝试过自定义,但没有成功 非常感谢你的帮助 谢谢。使用下面的库,它工作得非常好 XML文件 适配器代码 public类SwipeStackAdapter扩展了BaseAdapter{ 私有列表数据; 公共SwipeStackAdapter(列表数据){ this.mData=数据; } @凌驾 public int getCount(){ 返回mData.size(); } @凌驾

我无法为卡片堆栈实现正确的UI

请检查这张照片,这是我必须尽快满足的要求

我也用过,但UI不符合要求,我也尝试过自定义,但没有成功

非常感谢你的帮助
谢谢。

使用下面的库,它工作得非常好

XML文件


适配器代码

public类SwipeStackAdapter扩展了BaseAdapter{
私有列表数据;
公共SwipeStackAdapter(列表数据){
this.mData=数据;
}
@凌驾
public int getCount(){
返回mData.size();
}
@凌驾
公共字符串getItem(int位置){
返回mData.get(位置);
}
@凌驾
公共长getItemId(int位置){
返回位置;
}
@凌驾
公共视图getView(最终整数位置、视图转换视图、视图组父视图){
convertView=GetLayoutFlater()。充气(R.layout.card,父项,false);
TextView textViewCard=(TextView)convertView.findViewById(R.id.textViewCard);
textViewCard.setText(mData.get(position));
返回视图;
}
}

我不尝试这可能对您有帮助@Er.Arjunsaini感谢您的回复让我评估此链接感谢您的回复我正在评估此解决方案。这是一个很好的解决方案,但定制与我所附图片相同的用户界面变得越来越困难。
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clipChildren="false">

    <link.fls.swipestack.SwipeStack
        android:id="@+id/swipeStack"
        android:layout_width="320dp"
        android:layout_height="240dp"
        android:padding="32dp"/>

</FrameLayout>
public class SwipeStackAdapter extends BaseAdapter {

    private List<String> mData;

    public SwipeStackAdapter(List<String> data) {
        this.mData = data;
    }

    @Override
    public int getCount() {
        return mData.size();
    }

    @Override
    public String getItem(int position) {
        return mData.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
        convertView = getLayoutInflater().inflate(R.layout.card, parent, false);
        TextView textViewCard = (TextView) convertView.findViewById(R.id.textViewCard);
        textViewCard.setText(mData.get(position));

        return convertView;
    }
}