AppCompatButton与Button的区别

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 to Eclair MR1.
  • Allows dynamic tint of it background via the background tint methods in ViewCompat.
  • Allows setting of the background tint using backgroundTint and backgroundTintMode.

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.

猜你喜欢

转载自blog.csdn.net/qq_32916805/article/details/79589292