Design Lib - Coordinatorlayout/Collapsingtoolbarlayout with Gridview/Listview

Design lib - CoordinatorLayout/CollapsingToolbarLayout with GridView/listView

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 +)

CoordinatorLayout not working

I believe you need to make your ListView implement both ScrollingView and NestedScrollingChild interfaces.

It's not the easiest thing, but you should be able to do it if you look at RecyclerView's source code. It makes use of a NestedScrollingChildHelper and you should be able to do the same.

Gridview not showing/hiding toolbar

Currently the ListView and the GridView have the expected behavior with the CoordinatorLayout only with API>21.

To obtain this behavior you have to set:

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

You can find more info here.

Can't scroll completely down in ViewPager with NestedScrollView in CollapsedToolBarLayout

Answer for your EDIT: Try using setNestedScrollingEnabled(false) on your GridView



Related Topics



Leave a reply



Submit