Android中View和ViewGroup之间的区别 [英] Difference between View and ViewGroup in Android
本文介绍了Android中View和ViewGroup之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Android编程中,View
和ViewGroup
有什么区别?
What is the difference between a View
and a ViewGroup
in Android programming?
推荐答案
查看
-
View
对象是Android中用户界面(UI)元素的基本构建块. -
View
是一个简单的矩形框,用于响应用户的操作. - 例如
EditText
,Button
,CheckBox
等. -
View
引用android.view.View
类,它是所有UI类的基类.
View
objects are the basic building blocks of User Interface(UI) elements in Android.View
is a simple rectangle box which responds to the user's actions.- Examples are
EditText
,Button
,CheckBox
etc.. View
refers to theandroid.view.View
class, which is the base class of all UI classes.
ViewGroup
-
ViewGroup
是不可见的容器.它包含View
和ViewGroup
- 例如,
LinearLayout
是ViewGroup
,其中包含Button(View)和其他布局. -
ViewGroup
是布局的基类.
ViewGroup
is the invisible container. It holdsView
andViewGroup
- For example,
LinearLayout
is theViewGroup
that contains Button(View), and other Layouts also. ViewGroup
is the base class for Layouts.
这篇关于Android中View和ViewGroup之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文