📌  相关文章
📜  如何获得元素 android 的可见性 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:38.758000             🧑  作者: Mango

代码示例2
//If the image is part of the layout it might be "View.VISIBLE" but 
//that doesn't mean it's within the confines of the visible screen. 
//If that's what you're after; this will work:

Rect scrollBounds = new Rect();
scrollView.getHitRect(scrollBounds);
if (imageView.getLocalVisibleRect(scrollBounds)) {
    // imageView is within the visible window
} else {
    // imageView is not within the visible window
}