Friends, I'm trying to set height of view1 to the height of the filled text textView1, but it doesn’t work. view1 is thus infinitely long and exceeds the height of the text, occupies the entire screen, but I need to the end of the text.
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/cv">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="3"
android:background="@android:color/white">
<View
android:id="@+id/view1"
android:background="@drawable/rectangle_with_color"
android:layout_height="wrap_content"
android:layout_width="16dp" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="25dp"
android:layout_marginTop="3dp"
android:text="Не следует, однако забывать, что начало повседневной работы по формированию позиции представляет собой интересный эксперимент проверки новых предложений. С другой стороны реализация намеченных плановых заданий представляет собой интересный эксперимент проверки форм развития."
android:gravity="top"
/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
rectangle_with_color.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="#E41300" />
</shape>