I use a LinearLayout (with some content) as the view for my cells in a GridView. The problem is that although I have specified the height of the layout (android:layout_height="50pt") There are some cells that are bigger. The layout is vertical and the items inside have no height(0pt), but they have weight, there are 2 TextViews and 1 ImageView inside. I noticed that the image inside the cells that cause the problem is a bit bigger, but still why would the view grow? I would appreciate your help.
XML:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="50pt"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/ivHero"
android:layout_width="match_parent"
android:layout_height="0pt"
android:layout_weight="4"
android:background="@color/white"
app:srcCompat="@drawable/avatar" />
<TextView
android:id="@+id/tvName"
android:layout_width="match_parent"
android:layout_height="0pt"
android:layout_weight="1"
android:gravity="center"
android:singleLine="true"
android:text="TextView"
android:textColor="@color/white"
android:textSize="7pt" />
<TextView
android:id="@+id/tvPercent"
android:layout_width="match_parent"
android:layout_height="0pt"
android:layout_weight="1"
android:gravity="center"
android:text="20%"
android:textColor="@color/white"
android:textSize="7pt" />