I would like to have a button with 2 lines of text and if text is longer than 2 lines and size of maxWidth, the text should fit into the button borders.
android:maxLines="2"
doesn't work
Any tips?
I would like to have a button with 2 lines of text and if text is longer than 2 lines and size of maxWidth, the text should fit into the button borders.
android:maxLines="2"
doesn't work
Any tips?
Use something like:
<com.google.android.material.button.MaterialButton
android:layout_width="150dp"
android:layout_height="wrap_content"
android:maxLines="2"
../>
Android normal Button
widget not having as such functionality.
You have to use the android new library
implementation 'com.google.android.material:material:1.0.0-beta01'
Here is the reference.
@Gabriele Mariotti Already define the one way to use of it.