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"