Android : Set height of children in RecyclerView?

on Sunday, October 26, 2014


I am trying to use RecyclerView in a similar way to ViewPager (Vertical).


I have setup fling and scroll gestures so the views are scrolled in exactly the same way as ViewPager but now I would like to setup children views (LinearLayoutManager) and LinearLayout used for each child view to fill screen instead of wrap_content. I have made all views to match_parent and fill_parent but that does not work.


I did this:


holder.layout.setMinimumHeight(this.recyclerView.getMeasuredHeight());


Which is nice but when the orientation changes then layout overflows the screen which makes smooth scrolling/gestures flicker etc. I don't want it to overflow the screen.


Any good tips how to make it properly so all children are laid out to maximum height of the screen but do not overflow?


Thanks


0 comments:

Post a Comment