I have a relative layout like below,when I hardcoded the RelativeLayout
height to 25dp,it have no problem,it shown like image below.
What I want is,when the red horizontal line can expand the height automatically when the TextView
become multiple line,but not hardcoded height.
Here is my code
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:id="@+id/line"
android:layout_width="3dp"
android:layout_height="match_parent"
android:background="@color/blue" />
<TextView
android:id="@+id/TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:layout_toEndOf="@+id/line"
android:layout_toRightOf="@+id/line"
android:text="TextView"
android:textColor="@color/black"
android:textSize="14sp" />
</RelativeLayout>
When I change RelativeLayout
height to wrap_content
,the vertical line become invisible.
So my question is,how to make a vertical line
which height can be expandable depend on height of TextView
?