I have a NestedScrollView as the root element and there is a button that overlaps some of the content. How to track that NestedScrollView scrolls down to hide the button at this moment?

    1 answer 1

    You need to pass your implementation of the OnScrollChangeListener interface to the setOnScrollChangeListener method of your NestedScrollView . There is only one method in this interface.

     void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY); 

    Using the parameters scrollY and oldScrollY you can determine where the user scrolls.

    • thanks a lot, this is what you need - Howling