Answers for "how to get visibility of element android"

C
0

how to get visibility of element android

//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
}
Posted by: Guest on November-01-2021
0

how to get visibility of element android

// simple answer for simply checking if it's VISIBLE or INVISIBLE
View.isShown()
Posted by: Guest on November-01-2021

Code answers related to "how to get visibility of element android"

Code answers related to "C"

Browse Popular Code Answers by Language