I am creating a new UI in my code. Please refer to the below Picture. There are 3 views V1, V2 and V3. When V2 reaches to V3. The text has to go to the second line.
Can somebody help me out with this?
I am creating a new UI in my code. Please refer to the below Picture. There are 3 views V1, V2 and V3. When V2 reaches to V3. The text has to go to the second line.
Can somebody help me out with this?
You can do it by below code, textView's Gravity u can set what u want,
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/ivV1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@tools:sample/avatars" />
<TextView
android:id="@+id/tvV2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="start"
android:text="nakld"
app:layout_constraintEnd_toStartOf="@+id/ivV3"
app:layout_constraintStart_toEndOf="@+id/ivV1"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/ivV3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@tools:sample/avatars" />
</androidx.constraintlayout.widget.ConstraintLayout>