AppCompatButton与Button的区别
自定义控件的时候会发现Android studio提示Button已被AppCompatButton取代,AppCompatButton继承自Button,新增加了对动态的背景颜色等功能的支持.
A
Button
which supports compatible features on older version of the platform, including:
- Supports
textAllCaps
style attribute which works back toEclair MR1
.- Allows dynamic tint of it background via the background tint methods in
ViewCompat
.- Allows setting of the background tint using
backgroundTint
andbackgroundTintMode
.This will automatically be used when you use
Button
in your layouts. You should only need to manually use this class when writing custom views.