listvie y轴 监听滑动距离
来源:互联网 发布:网络主播名字大全女 编辑:程序博客网 时间:2024/06/05 20:02
主要是滑动监听@Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { L.d(TAG,"监听条目的显示状态++--"+firstVisibleItem); if (firstVisibleItem<2){ mTopBarBg.setAlpha(0.0f); }else { mTopBarBg.setAlpha(1.0f); } mCurrentfirstVisibleItem = firstVisibleItem; View firstView = view.getChildAt(0); if (null != firstView) { ItemRecod itemRecord = (ItemRecod) recordSp.get(firstVisibleItem); if (null == itemRecord) { itemRecord = new ItemRecod(); } itemRecord.height = firstView.getHeight(); itemRecord.top = firstView.getTop(); recordSp.append(firstVisibleItem, itemRecord); } L.d(TAG, "滑动距离getScrollY()="+getScrollY()); }});/** * 滑动距离 * @return */private int getScrollY() { int height = 0; for (int i = 0; i < mCurrentfirstVisibleItem; i++) { ItemRecod itemRecod = (ItemRecod) recordSp.get(i); if (itemRecod != null) { height += itemRecod.height; } } ItemRecod itemRecod = (ItemRecod) recordSp.get(mCurrentfirstVisibleItem); if (null == itemRecod) { itemRecod = new ItemRecod(); } return height - itemRecod.top;}public class ItemRecod { int height = 0; int top = 0;}
0 0
- listvie y轴 监听滑动距离
- PullToRefreshScrollView实现y轴滑动监听
- ListView监听滑动距离
- 获取ListView在Y轴的精确滑动距离(单位px)
- Android 监听ScrollView滑动距离简单处理
- 小距离监听ListView或者ScrollView上下滑动
- android 监听webView滑动距离和标题栏颜色渐变
- 安卓开发监听recyclerview的滑动时某一控件距离顶部的距离来做显示隐藏某些布局
- 如何监听listview的滚动事件——获取listview有效滑动的距离
- hellocharts实现y轴固定和x轴滑动效果
- (无JS)微信端纯H5的X,Y轴滑动
- Android监听距离传感器
- Scrollview的滑动距离
- 获取Listview滑动距离
- Scrollview 滑动距离
- RecyclerView滑动距离计算
- listview滑动距离
- 设置滑动的距离
- Socket心跳包机制
- bzoj1047(单调队列,矩阵中)
- poj 3281 Dining(网络流)
- 百度面试(数据库隔离级别、overload、override)
- 多线程的编程题目(一)
- listvie y轴 监听滑动距离
- Android studio 中NameValuePair跟BasicNameValuePair 不能正常导包问题
- 文章标题
- viewPager限时滚动
- iOS 开眼效果中的视差效果(UITableViewController)
- JAVA中常说的三大框架指:SSH
- Android 屏幕旋转 处理 AsyncTask 和 ProgressDialog 的最佳方案
- windows下多线程通信方法
- 强制把系统缓存写入文件sync和fsync函数,, fflush和fsync的联系和区别