Extend from View or Its Subclasses
A view must be a subclass of View
. To implement a view, you shall extend from View
or its subclasses.
Here are a few existent subclasses that you might extend from:
View
: the most fundamental class.ScrollView
: a view container that allows the user to scroll the content in a smaller viewport.Section
: a view that also implementsIDSpace
. It is also a good example to see how a view implementsIDSpace
.TextView
: a view for displaying text and Web content. You can use it if you'd like to display Web content in a part of your view.
In additions to extending from them (the is-a relation), you can use them as a member (the has-a relation). For more information, please refer to the Build with Composite of Views chapter.