How to know if a RecyclerView has enough content to scroll?

后端 未结 3 1208
我寻月下人不归
我寻月下人不归 2021-01-23 05:11

Currently I am using a RecyclerView with a LinearLayout Manager and an EditText as HeaderView for filtering the content of the list.

I would like to hide the EditText if

3条回答
  •  臣服心动
    2021-01-23 05:29

    do you mean this:

    https://developer.android.com/reference/android/support/v7/widget/RecyclerView.LayoutManager.html#canScrollVertically()

    if(recyclerView.getLayoutManager().canScrollVertically()){
        // do stuff
    } else{
        // do other stuff
    }
    

提交回复
热议问题