Is there something instead of backgroundTint for api level less than 21?<
Asked
Active
Viewed 219 times
1 Answers
0
Just use app:backgroundTint instead of android:backgroundTint, the tint will take effect below Lollipop. The reason is AppCompatActivity AppCompatDelegateImplV7 use AppCompatViewInflater to auto change Button or TextView to AppCompatButton or AppCompatTextView, then app:backgroundTint take effect.
-
will this support for API > 21 – byte_bx Sep 18 '16 at 17:26
-
Yes.. it should.. try it out. – JTeam Sep 18 '16 at 17:29
-
what changes i have to make in other files or same files to use it? – byte_bx Sep 18 '16 at 17:46
-
just change **android:backgroundTint** to **app:backgroundTint** in your layout xml – JTeam Sep 18 '16 at 18:08
-
It does not work . It say unexpected namespace prefix "app" found for tag Button – byte_bx Sep 19 '16 at 10:08
-
**xmlns:app="http://schemas.android.com/apk/res-auto"** Add the app name space at top of XML... – JTeam Sep 20 '16 at 03:09
-
Thanks, It's working :) – byte_bx Oct 24 '16 at 11:09
-
You can mark this as answer, as it is working for you. – JTeam Dec 25 '16 at 11:11