![](/img/trans.png)
[英]Can't scroll completely down in ViewPager with NestedScrollView in CollapsedToolBarLayout
[英]How to get nestedscrollview can scroll or not?
有什么辦法可以使nestedscrollview有一些滾動元素。 我想在應用程序中放置一些向下箭頭指示,如果有滾動項目,用戶將通過向下箭頭指示。
由https://stackoverflow.com/a/18574328/7384780的代碼標識。 您可以這樣做。
NestedScrollView scrollView = findViewById(R.id.nestedScrollView);
int childHeight = ((LinearLayout)findViewById(R.id.scrollContent)).getHeight();
boolean isScrollable = scrollView.getHeight() < childHeight +
scrollView.getPaddingTop() + scrollView.getPaddingBottom();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.