简体   繁体   English

AppCompat视图与普通Android视图之间的差异

[英]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 . 例如, AppCompatEditTextEditText之间或AppCompatButtonButton之间的区别。

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 . 当您使用ButtonEditText您实际上正在使用AppCompatButtonAppCompatEditText 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都有自己的差异。

  • AppCompatEditText vs EditText AppCompatEditText与EditText

Allows textAllCaps style attribute up to Gingerbread. 允许textAllCaps样式属性到姜饼。

  • AppCompatSpinner vs Spinner AppCompatSpinner与Spinner

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.

相关问题 Android中View和ViewGroup的区别 - Difference between View and ViewGroup in Android View和Subview之间的区别 - Android - Difference between View and Subview - Android android:text =“ @ string / hello”和常规右键单击之间的区别->文本视图组件-> EditText - Difference between android:text=“@string/hello” and normal right click--> Text view component--> EditText 在Android的普通视图和GLsurface视图之间切换的最佳方法是什么 - Whats the best way to switch between a normal view and a GLsurface view, Android View.VISIBLE和常规int使用的int有什么区别? - What is the difference between the int used by View.VISIBLE and normal ints? appcompat_v7和android-support-v7-appcompat之间的区别? - Difference between appcompat_v7 and android-support-v7-appcompat? Android 框架小部件与其 AppCompat 版本之间的区别 - Difference between Android Framework widgets and their AppCompat version 活动处理程序和视图处理程序android之间的区别 - Difference between activity handler and view handler android Android中的View上的setMinHeight和setMinimumHeight有什么区别? - What is the difference between setMinHeight and setMinimumHeight on a View in Android? Android中的View和widget之间有什么区别? - What is the difference between a View and widget in Android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM