Is there any way to get that nestedscrollview have some element for scroll or not. I want to put some down arrow indication in app in which user will indicate through a down arrow if it's having item for scroll.
Asked
Active
Viewed 55 times
1 Answers
0
Inpired by code from https://stackoverflow.com/a/18574328/7384780. You can do it like this.
NestedScrollView scrollView = findViewById(R.id.nestedScrollView);
int childHeight = ((LinearLayout)findViewById(R.id.scrollContent)).getHeight();
boolean isScrollable = scrollView.getHeight() < childHeight +
scrollView.getPaddingTop() + scrollView.getPaddingBottom();

Abhijeet Kumar
- 343
- 2
- 8