Answer the question
In order to leave comments, you need to log in
Why isn't the background applied to the button?
Why can't I apply a background to a button? It just doesn't apply the background I want.
Button Code
<Button
android:id="@+id/loginBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:background="@drawable/button_2"
android:text="Already have an account?"
android:textColor="@color/colorWhite" />
Answer the question
In order to leave comments, you need to log in
Found two solutions. You need to change the theme Theme.MaterialComponents
to Theme.AppCompat
or instead of the usual use
I used the second option! <Button>
<android.widget.Button>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question