码迷,mamicode.com
首页 > 其他好文 > 详细

滑动关闭实现

时间:2015-03-29 13:45:51      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:

1.加载gradle依赖:compile ‘com.github.liuguangqiang.swipeback:library:0.3.0@aar‘

2.在布局上加入布局标签

<com.liuguangqiang.swipeback.SwipeBackLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/swipeBackLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
3.代码中获取这个对象,设置滑动方向:swipeBackLayout.setDragEdge(SwipeBackLayout.DragEdge.LEFT);

注意:要在主题里进行一些设置,必须包含:否则滑动效果背景有问题

<!-- 窗口的背景颜色 -->
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowIsTranslucent">true</item>


滑动关闭实现

标签:

原文地址:http://blog.csdn.net/u013173289/article/details/44725739

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!