Описание тега android-view
Introduction
A View
in Android is the display of the data utilized by the application. View
s range widely from simple and non-interactive to complex and interactive in many ways. In addition to the View
s provided by the SDK, developers have the option to create custom View
s. This means that virtually any communication or display to the user may be handled in innumerable ways.
ViewGroups
ViewGroup
is a subclass of View
, which has the ability to hold other View
s. Children View
s may be added to the ViewGroup
at run-time (in Java code) or may be pre-defined in Android XML. Like View
s, ViewGroup
s may also be extended in the same way. Follow these guidelines for questions regarding ViewGroup
s:
- If the
ViewGroup
is provided by the Android SDK, it should be listed below in Standard Views. - If the
ViewGroup
is a CustomView
, use android-custom-view
Standard Views
A wide variety of Views are delivered with the Android SDK for use by developers. These views make up a majority of the Views in a standard application. Each View has its own semantics and behaviors. As a result, it is often more beneficial to use the tags specifically related to those Views. Below is a list of standard views provide within the Android SDK:
ListView
s utilize the android-listview tag.TabHost
s utilize the android-tabhost tag.TextView
s display text to the user: utilize the android-textview tag.EditText
s allow the user to input text: utilize the android-edittext tag.WebView
s display web pages or other web related content: utilize the android-webview tag.ImageView
s display images or drawables: utilize the android-imageview tag.GridView
s utilize the android-gridview tag.
Usage: android-view vs. android-layout
While View
s and layouts work hand-in-hand, questions regarding the two are often very different. These guidelines will help to properly determine which tag to use:
- If the question refers to the properties used to display the
View
properly, then use android-layout. - If, instead, the question refers to the functionality of the
View
, then android-view is appropriate.