Difference between View and ViewGroup in Android

后端 未结 11 1503
暖寄归人
暖寄归人 2020-12-02 08:11

What is the difference between a View and a ViewGroup in Android programming?

11条回答
  •  旧时难觅i
    2020-12-02 08:48

    In simple words View is the UI element which we interact with when we use an app,like button,edit text and image etc.View is the child class of Android.view.View While View group is the container which contains all these views inside it in addition to several othe viewgroups like linear or Frame Layout etc. Example if we design & take the root element as Linear layout now our main layout is linear layout inside it we can take another view group (i.e another Linear layout) & many other views like buttons or textview etc.

提交回复
热议问题