How to change the color of a button?

后端 未结 8 1844
臣服心动
臣服心动 2021-02-03 20:08

I\'m new to android programming. How do I change the color of a button?

8条回答
  •  名媛妹妹
    2021-02-03 20:42

    For the text color add:

    android:textColor=""
    


    For the background color add:

    android:background=""
    


    From API 21 you can use:

    android:backgroundTint=""
    android:backgroundTintMode=""
    

    Note: If you're going to work with android/java you really should learn how to google ;)
    How to customize different buttons in Android

提交回复
热议问题