视图和小部件之间有什么区别? [英] What is the difference between Views and widgets?
问题描述
如果我没记错的话, View
是所有小部件的超类,但是如何区分View和小部件?例如,按钮或文本框,我应该怎么称呼它们(视图或窗口小部件)?
调用它们之一就可以了.
我倾向于将术语"widget"用于 View
的子类,这些子类默认情况下对用户具有可视化的表示形式-例如 TextView
, Button
, ListView
等
我倾向于将术语视图"用于 View
的任何子类,包括诸如 LinearLayout
之类的纯容器./p>
但是,再次强调,用这两个术语来称呼它们都没有特别的危害.
If I am not wrong, View
is the superclass for all widgets, but how do I differentiate between a View and a widget? For example, a button or a text box, what should I call them (a View or a widget)?
Calling them either is fine.
I tend to use the term "widget" for subclasses of View
that have a visual representation to the user by default -- things like TextView
, Button
, ListView
, etc.
I tend to use the term "view" for something that could be any subclass of View
, including pure containers like LinearLayout
.
But, again, there is no particular harm in referring to them by either term.
这篇关于视图和小部件之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!