Android setBackgroundTintList on pre-lollipop devices

前端 未结 3 1352
日久生厌
日久生厌 2020-12-29 07:26

I\'m working with FloatingActionButton. The user should be able to switch the FAB background color within a onClick Event.

However, the rec

3条回答
  •  醉梦人生
    2020-12-29 07:58

    simple:

    fab.setBackgroundTintList(ColorStateList.valueOf(0xFF4CAF50));
    

    fab is your FloatingActionButton of course and 0xFF4CAF50 just a example color

提交回复
热议问题