Android text View


/ Published in: XML
Save to your folder(s)

To change your textview id
android:id=”@+id/TextView”

To change your textview text
android:text=”This is my first textview sample application”

To enable or disable textview
android:enabled=”false”

To change your textview width & height
android:layout_height=”wrap_content”
android:layout_width=”fill_parent”

To change your textview background
android:background=”@drawable/icon”

To change your textview text size
android:textSize=”16px”

To change your textview text style
android:textStyle=”bold”


Copy this code and paste it in your HTML
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout android:id="@+id/LinearLayout01"
  3. android:layout_width="fill_parent"
  4. android:layout_height="fill_parent"
  5. xmlns:android="http://schemas.android.com/apk/res/android">
  6. <TextView android:text="This is my first textview sample application"
  7. android:id="@+id/TextView"
  8. android:layout_height="wrap_content"
  9. android:layout_width="fill_parent"
  10. android:background="@drawable/icon"
  11. android:textSize="16px"
  12. android:textStyle="bold">
  13. </TextView>
  14. </LinearLayout>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.