Last active
March 24, 2021 08:04
-
-
Save petitJAM/040782f19e18f9feca4c28f0df6ed19f to your computer and use it in GitHub Desktop.
Ellipsize TextView with 0dp in ConstraintLayout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<TextView | |
android:id="@+id/textView" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginStart="16dp" | |
android:layout_marginEnd="16dp" | |
android:ellipsize="end" | |
android:maxLines="4" | |
app:layout_constrainedWidth="true" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toTopOf="parent" /> | |
<!-- layout_constrainedWidth="true" is key --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your solution was really helpful in guiding my usecase and used below code
Thanks a lot.