Is there a way to make a LinearLayout have the same height as a TextView?
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/blue"/>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
app:srcCompat="@drawable/edit"/>
<ImageView
android:id="@+id/lista_imagem"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
app:srcCompat="@drawable/avatar"
android:layout_marginStart="5dp" />
<TextView
android:id="@+id/lista_nome"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toEndOf="@+id/lista_imagem"
android:layout_toRightOf="@+id/lista_imagem"
android:text="Titulo"
android:textSize="12sp"
android:textStyle="bold" />
I wanted the
android:layout_height=""
From my linear layout it had the same size as the TextView lista_nome
, remembering that this should be wrap_content
because the text changes size. Is there a way to do this? I know by the way you set a default value, but would you have a way to make this value equal to that of TextView, for example?
Edit: TextView can not stay within this LinearLayout