[英]Difference between an AppCompat view and a normal Android view
What is the difference between an AppCompat
view component and a standard/default view component? AppCompat
视图组件和标准/默认视图组件之间有什么区别?
For example, the difference between an AppCompatEditText
, and an EditText
, or between an AppCompatButton
and a Button
. 例如,
AppCompatEditText
与EditText
之间或AppCompatButton
与Button
之间的区别。
Looking at the developer docs for android.support.v7.widget
, the AppCompat
view components are described as " tint aware ", but is this the only difference, and what exactly does this do? 查看
android.support.v7.widget
的开发人员文档 , AppCompat
视图组件被描述为“ tint aware ”,但这是唯一的区别,这究竟是做什么的?
When you are using a Button
or an EditText
you are actually using AppCompatButton
and AppCompatEditText
. 当您使用
Button
或EditText
您实际上正在使用AppCompatButton
和AppCompatEditText
。 From the official documentation of the AppCompatEditText
. 来自
AppCompatEditText
的官方文档。
A tint aware EditText.
一个提示意识的EditText。 This will automatically be used when you use EditText in your layouts.
当您在布局中使用EditText时,将自动使用此选项。 You should only need to manually use this class when writing custom views
编写自定义视图时,您只需要手动使用此类
What is the difference between an AppCompat view component and a standard/default view component?
AppCompat视图组件和标准/默认视图组件之间有什么区别?
AppCompat View Component supports compatible features on older version of the platform. AppCompat View Component支持旧版本平台上的兼容功能。
the AppCompat view components are described as "tint aware", but is this the only difference, and what exactly does this do?
AppCompat视图组件被描述为“tint aware”,但这是唯一的区别,这究竟是做什么的?
Although most of the AppCompatView only difference is it allows dynamic tint and background tint. 虽然大多数AppCompatView唯一的区别是它允许动态色调和背景色调。 Tint aware is not the only difference, each AppCompatView has its own differences, for example.
Tint意识不是唯一的区别,例如,每个AppCompatView都有自己的差异。
Allows textAllCaps style attribute up to Gingerbread. 允许textAllCaps样式属性到姜饼。
Setting the popup theme using popupTheme. 使用popupTheme设置弹出主题。
You can dig down each view difference in Android docs . 您可以挖掘Android文档中的每个视图差异。
However, as Sid / Docs says, you don't have to specify this on your layouts since it will automatically converted to AppCompat views. 但是,正如Sid / Docs所说,您不必在布局上指定它,因为它会自动转换为AppCompat视图。 But, if you want to create custom view, you should use AppCompat Views, or else this bug will happens.
但是,如果要创建自定义视图,则应使用AppCompat Views,否则会发生此错误 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.