Android:如何检查ScrollView内部的视图是否可见?
ScrollView
Views
ScrollView
Rect bounds = new Rect();view.getDrawingRect(bounds);Rect scrollBounds = new Rect(scroll.getScrollX(), scroll.getScrollY(), scroll.getScrollX() + scroll.getWidth(), scroll.getScrollY() + scroll.getHeight());if(Rect.intersects(scrollBounds, bounds)){ //is visible}
猛跑小猪
相关分类