Android框架部件和他们的应用程序兼容性版本之间的区别他们的、兼容性、部件、应用程序

2023-09-06 23:45:37 作者:不将就

我最近注意到,有Android中最视图类型,例如的ListView / ListViewCompat 的应用程序兼容性版本,按钮 / AppCompatButton 等。

I have lately noticed that there are AppCompat versions of most View types in Android, for example ListView / ListViewCompat, Button / AppCompatButton etc.

有关这些更简单浏览次数(不包括例如SwitchCompat),什么是他们和Android Framework版本之间的区别?我还没有发现任何文件,在这个问题上...

For these more simple Views (not counting for example SwitchCompat), what are the difference between them and the Android Framework version? I have not found any documentation on this matter...

我想知道选择任一版本和后果是否有艇员选拔一个比其他任何优势。

I'm interested in knowing the consequences of choosing either version and if there are any advantages in chosing one over the other.

具体做法是:

的ListView ListViewCompat 的区别之间的差异按钮 / AppCompatButton ImageView的区别 / AppCompatImageView 的EditText / AppCompatEditText 的区别 的TextView / AppCompatTextView 的区别 Difference between ListView and ListViewCompat Difference between Button / AppCompatButton Difference between ImageView / AppCompatImageView Difference between EditText / AppCompatEditText Difference between TextView / AppCompatTextView

我是从正常状态变为应用程序兼容性的版本与期望的颜色会从主题中使用和看起来一样的棒棒堂和pre-棒棒糖,而在于对一些看法相反的效果(如ListView控件)

I changed from normal to AppCompat versions with the expectation that colors would be used from the theme and look the same on Lollipop and pre-lollipop, but it rather had the opposite effect on some views (such as ListView)

推荐答案

应用程序兼容性是支持Android操作系统就像应用程序兼容性-V7的旧版本在Android 6.1.1支持到Android 2.6.0

AppCompat is support older version of android os like AppCompat-v7 is support from android 6.1.1 to android 2.6.0

以上。

文档

色调知道小部件的appcompart提供的完整列表。

The full list of tint aware widgets available in appcompart

AppCompatAutoCompleteTextView
AppCompatButton
AppCompatCheckBox
AppCompatCheckedTextView
AppCompatEditText
AppCompatMultiAutoCompleteTextView
AppCompatRadioButton
AppCompatRatingBar
AppCompatSpinner
AppCompatTextView

ListViewCompat是的ListView 的同他人

ListViewCompat is subclass of ListView same others

编辑:

为什么既类框架可用或 Android的支持库是如何工作的?