Issue
Why the button text it's not wrap_content and gone when I custom Hight and custom background?
XML Code:
<Button
android:id="@+id/button_create"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_marginEnd="8dp"
android:background="@drawable/bg_button_3"
android:text="@string/create"
android:theme="@style/FontTheme1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Solution
Your issue is the height. Use:
android:layout_height="wrap_content"
In any case you don't need a custom background to have rounded corners.
Just use:
<com.google.android.material.button.MaterialButton
....
style="@style/Widget.MaterialComponents.Button"
app:cornerRadius=".."
.../>
Answered By - Gabriele Mariotti
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.