What is TextView
Description
The TextView
view is used to display text to the user.
This is the most basic view and one that you
will frequently use when you develop Android applications.
If you need to allow users to edit the text
displayed, you should use the subclass of TextView
, EditText
.
In some other platforms, the TextView
is commonly known as the label
view. Its sole purpose is to display text on the screen.
Example
The following layout xml resource file has
a definition for TextView
.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
</LinearLayout>