Changing RadioButton color on API 19 and below?

后端 未结 1 492
难免孤独
难免孤独 2020-12-07 03:53

So I have an app in which the user can select a color by choosing from a set of RadioButtons, I have used the ButtonTint XML attribute to color the

相关标签:
1条回答
  • 2020-12-07 04:31

    Use design support library (23.2.0 OR latest) and appcompatwidgets as below

    Material Design for Pre-Lollipop Devices :

    AppCompat (aka ActionBarCompat) started out as a backport of the Android 4.0 ActionBar API for devices running on Gingerbread, providing a common API layer on top of the backported implementation and the framework implementation. AppCompat v21 delivers an API and feature-set that is up-to-date with Android 5.0


    Android Support Library 22.1 :

    The ability to tint widgets automatically when using AppCompat is incredibly helpful in keeping strong branding and consistency throughout your app. This is done automatically when inflating layouts - replacing Button with AppCompatButton, TextView with AppCompatTextView, etc. to ensure that each could support tinting. In this release, those tint aware widgets are now publicly available, allowing you to keep tinting support even if you need to subclass one of the supported widgets.

    This tint aware widgets are now publicly available, allowing you to keep tinting support even if you need to subclass one of the supported widgets.

    From link above,

    The full list of tint aware widgets at this time is:

    AppCompatAutoCompleteTextView
    AppCompatButton
    AppCompatCheckBox
    AppCompatCheckedTextView
    AppCompatEditText
    AppCompatMultiAutoCompleteTextView
    AppCompatRadioButton
    AppCompatRatingBar
    AppCompatSpinner
    AppCompatTextView
    
    0 讨论(0)
提交回复
热议问题