Design lib - CoordinatorLayout/CollapsingToolbarLayout with GridView/listView

前端 未结 6 1216
别跟我提以往
别跟我提以往 2020-11-30 07:54

This might be silly question but I didn\'t understand Design lib well. I am following this reference to create below layout. The Blue area should work as parallax when I scr

6条回答
  •  死守一世寂寞
    2020-11-30 08:03

    With ListView/GridView, it works only on Lollipop by following code-

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
         listView.setNestedScrollingEnabled(true);
    }
    

    I think for Now CoordinatorLayout works only with RecyclerView and NestedScrollView

    EDIT :

    use -

    ViewCompat.setNestedScrollingEnabled(listView/gridview,true); (add Android Support v4 Library 23.1 or +)
    

提交回复
热议问题