Voora Tarun Voora Tarun - 10 months ago 107
Android Question

Check a child view visible on screen or not in NestedScrollview

In my activity, I have a long scrollview contains multiple views, when a user is scrolling up or down, I have to check whether a textview is visible or not on screen.

Please help me .


You can use next code:

Rect mReact = new Rect();
if (mView.getLocalVisibleRect(mReact)) {
// visible
} else {
// invisible