Change color of a radio button

前端 未结 11 1877
死守一世寂寞
死守一世寂寞 2020-12-10 02:11

I am developing an quiz based app. There will be 1 question and 4 option(radio buttons). If user select any wrong answer then I want to turn that radio button color to Red.

11条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-10 02:43

    The fastest thing to do is to set the buttonTint to your desired color:

     
    

    In your values/colors.xml put your color in this case a reddish one:

    #e75748
    

    Result:

    Colored Android Radio Button

    As @smashing pointed, this only will work on API level >= 21

提交回复
热议问题