簡體   English   中英

如何獲取nestedscrollview是否可以滾動?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM