What is the difference between Views and widgets?

前端 未结 5 687
深忆病人
深忆病人 2021-01-05 22:38

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 sho

5条回答
  •  梦毁少年i
    2021-01-05 23:19

    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.

提交回复
热议问题