判断scrollview中某子控件是否可见
16lz
2021-01-23
Android: how to check if a View inside of ScrollView is visible?
Solutions:
Rect scrollBounds = new Rect();scrollView.getHitRect(scrollBounds);if (childView.getLocalVisibleRect(scrollBounds)) { //子控件至少有一个像素在可视范围内 // Any portion of the childView, even a single pixel, is within the visible window } else { //子控件完全不在可视范围内 // NONE of the childView is within the visible window }
更多相关文章
- 控件:拖动条 --- SeekBar(改变屏幕亮度)
- android自定义支持横竖方向切换seekbar控件
- Android中AutoCompleteTextView控件的使用
- 使用命令行ls命令的Android文件浏览控件,适合于root过的设备,可以
- Android学习笔记(二)android studio基本控件及布局(实现图片查看器)
- android spinner控件自定义选择图层
- android代码编写布局和控件
- 实现Android的图片画廊控件ScrollGalleryView
- Android Widget添加自定义控件