Answer the question
In order to leave comments, you need to log in
Is it possible to resize RecyclerView?
I want to resize the RecyclerView itself on click. For example, it has width & height parameters:
wrap_content
match_parent
And on click I want to change to fixed parameters.
Answer the question
In order to leave comments, you need to log in
Wrap the RecyclerView in a RelativeLayout and apply LayoutParams to it.
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/images"
android:layout_width="wrap_content"
android:layout_height="360dp"
>
</android.support.v7.widget.RecyclerView>
</Relativelayout>
RelativeLayout.LayoutParams lp =
new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, 500);
recyclerView.setLayoutParams(lp);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question