'No text, only ellipsize
In Constarint layout I have two TextViews one beside another, horizontaly. And if the first TextView is too long the second one disapears. It's ok, but the second TextView leaves ellipsize, no text.
<TextView
android:id="@+id/full_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="start"
android:maxWidth="@dimen/profile_connections_name_size"
android:maxLines="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/user_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:ellipsize="end"
android:gravity="start"
android:maxLines="1"
app:layout_constraintBottom_toBottomOf="@id/full_name"
app:layout_constraintEnd_toEndOf="parrent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toEndOf="@id/full_name"/>
Here you can see how it looks like: https://i.imgur.com/lBKzTsa.png
Solution 1:[1]
adding android:singleLine="true" helped me :)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Rustam |
