TextView was added in API Level 1
1. Create an Android project, if you don't already have one.
2. Open the main.xml file and add the below code to add a TextView to the XML file between the Layout tags.
** For API Level < 8, use fill_parent
** For API Level 8+, use match_parent (fill_parent is deprecated)
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
/>
</LinearLayout>
3. Compile and run!
Next Recommended Article: android:text - Display Text in a TextView/EditText
Resources:
Popular Posts
- Save LogCat to a Text File
- android:ellipsize - Add an ellipsis(...) in a TextView
- android:scrollbarStyle - Change the Scrollbar Location/Style in a TextView
- Solution: error: Error parsing XML: unbound prefix
- Intent setType(String type) - How to Set an Explicit MIME data type
- Change the line spacing between lines of text in an TextView/EditText, using lineSpacingMultiplier
- android:gravity - Move Text inside a EditText (center, top, bottom, right, left, and more)
- android:alpha - Set the Opacity/Transparency of Text in TextView/EditText
- Cursor getColumnIndex - Get the Index for a Column Name
- Perform an Action after Enter keypress on EditText