Android UI Libs之AndroidSwipeLayout

本文介绍了AndroidSwipeLayout库的使用,包括侧滑删除和侧滑菜单的实现。配置依赖后,通过Show Mode、Drag edge设置,可以在XML布局和Java代码中灵活操作。文章提供了高级使用场景,如在RecyclerView中应用,并给出了相关API的详细说明。
摘要由CSDN通过智能技术生成

Android UI Libs之AndroidSwipeLayout


1. 说明


AndroidSwipeLayout,顾名思义,Android平台上的滑动布局,是一个可以让我们很方便使用滑动的库,典型的应用就是侧滑删除与侧滑菜单。

2. 配置


在模块中添加依赖:compile "com.daimajia.swipelayout:library:1.2.0@aar"

3.基本使用


1. Show Mode

  • LayDown
  • PullOut

2. Drag edge

  • LEFT
  • RIGHT
  • TOP
  • BOTTOM

3. 在xml布局文件中使用SwipeLayout

  • SwipeLayout的最后一个孩子是SurfaceView,其他孩子都是BottomView
  • BottomView最好添加上andorid:layout_gravity属性
 <com.daimajia.swipe.SwipeLayout
        android:layout_width="match_parent"
        android:layout_height="80dp">
        <!-- Bottom View Start-->
        <LinearLayout
            android:background="#66ddff00"
            android:id="@+id/bottom_wrapper"
            android:layout_width="160dp"
            android:layout_height="match_parent"
            android:orientation="vertical">
            <!--What you want to show-->
            <TextView
                android:text="欢迎关注我的微信公众号:Android技术漫谈"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />
        </LinearLayout>
        <!-- Bottom View End-->

        <!-- Surface View Start -->
        <LinearLayout
            android:padding="10dp"
  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值