All welcome. I use GridLayoutManager in Recycler. For some reason, some elements are stretched, others remain at normal height.
Here is the code of the item itself.
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/item_user_container" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="4dp" android:elevation="2dp"> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView android:id="@+id/user_img" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/default_avatar" /> <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/user_img"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageView android:id="@+id/search_btn_like" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="8dp" android:layout_weight="1" android:src="@drawable/cards_heart_red" /> <ImageView android:id="@+id/search_btn_chat" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="8dp" android:layout_weight="1" android:src="@drawable/message" /> </LinearLayout> </RelativeLayout> <RelativeLayout android:id="@+id/item_user_top_relative" android:layout_width="match_parent" android:layout_height="wrap_content" android:alpha="0.8" android:background="@android:color/white"> <TextView android:id="@+id/user_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@android:color/black" android:textSize="16sp" android:textStyle="bold" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/user_name" android:orientation="horizontal"> <TextView android:id="@+id/user_age" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="14sp" /> <TextView android:id="@+id/user_country" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8dp" android:textSize="14sp" /> </LinearLayout> </RelativeLayout> </RelativeLayout> </android.support.v7.widget.CardView> </RelativeLayout> Can you please tell me how to fix this?
