Do you know that every android application must have a user interface? This is achieved by use of view group and view objects on android devices. This article will explain about the commonly used view objects that are employed to display content on the screen.
View objects are mainly used to draw content on the screen of any android device. The easiest way to use this object is through an XML file. It occupies are rectangular position on the screen and is concerned with event handling and drawing.
How are android views used?
All the views are arranged in one tree. However, you can still add views using a code in one or the many XML files. The views have the ability to display content or images.
There are several operations that you can undertake after establishing a tree of views, including:
- The Setting of Properties- The methods used to set properties vary depending on the type of view you want to set. For instance,the setting of a text property you use a Textview.
- Set Focus- This will help the system to focus in response to the input from the user.
- Setting listeners- This will allow the clients to be notified when something exciting happens.For instance,they can be updated when focus is gained or lost on views.
- Set Visibility- This allows the user to either show or hide views.
Types of view available on android devices:
The main purpose of this view is to display content on the screen.It contains a complex logic that makes to display hyperlinks, emails and phone numbers amongst others.
The main objective of this view is to show images. The images may be saved in an app or downloaded via the internet.
Some of the view objects have many uses other than displaying the content.