實現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(); } 以上就是Android 滑動退出應用程序的實例,如有疑問請留言或者到本站社區交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
新聞熱點
疑難解答