软件编程
位置:首页>> 软件编程>> Android编程>> 实现Android 滑动退出Activity的功能

实现Android 滑动退出Activity的功能

作者:lqh  发布时间:2023-04-24 03:00:34 

标签:Android,滑动,退出

实现Android 滑动退出Activity的功能

android向右滑动,退出activity


//右滑删除
 compile 'com.jude:swipebackhelper:3.1.2'

 然后在Baseactivity中添加代码:

实现代码:


SwipeBackHelper.onCreate(this);
   SwipeBackHelper.getCurrentPage(this)
       .setSwipeBackEnable(true)
       .setSwipeSensitivity(0.5f)
       .setSwipeRelateEnable(true)
       .setSwipeRelateOffset(300);

@Override
 protected void onDestroy() {
   SwipeBackHelper.onDestroy(this);

super.onDestroy();
 }

来源:http://274137570-qq-com.iteye.com/blog/2390090

0
投稿

猜你喜欢

手机版 软件编程 asp之家 www.aspxhome.com