You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to get the screen width -10dp as the width of item,
I tried doing it in onCreateViewHolder:
viewHolder= new viewHolder(_inflate);
ViewGroup.LayoutParams _layoutParams = viewHolder.mCardView.getLayoutParams();
layoutParams.width=_layoutParams.width-10;
viewHolder.mCardView.setLayoutParams(_layoutParams);
But it doesn't work.
The text was updated successfully, but these errors were encountered:
I could suggest you to use match_parent as the item size and then apply the min/max scale. But you'll have to calculate the desired scale based on the measured item size.
I want to get the screen width -10dp as the width of item,
I tried doing it in onCreateViewHolder:
viewHolder= new viewHolder(_inflate);
ViewGroup.LayoutParams _layoutParams = viewHolder.mCardView.getLayoutParams();
layoutParams.width=_layoutParams.width-10;
viewHolder.mCardView.setLayoutParams(_layoutParams);
But it doesn't work.
The text was updated successfully, but these errors were encountered: