在滚动的视图观测滚动事件的Android库:Android-ObservableScrollView
在滚动的视图观测滚动事件的Android库
它易于与在Android 5.0 Lollipop中引入的工具条Toolbar相交互,并能够帮助实现Material Design apps的外观。
支持的控件
Widget | Since | Note |
---|---|---|
ListView | v1.0.0 | |
ScrollView | v1.0.0 | |
WebView | v1.0.0 | |
RecyclerView | v1.1.0 | It's supported but RecyclerView provides scroll states and position with OnScrollListener. You should use it if you don't have any reason. |
GridView | - |
@Override public void onUpOrCancelMotionEvent(ScrollState scrollState) { ActionBar ab = getSupportActionBar(); if (scrollState == ScrollState.UP) { if (ab.isShowing()) { ab.hide(); } } else if (scrollState == ScrollState.DOWN) { if (!ab.isShowing()) { ab.show(); } } }
本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!