Articles‎ > ‎Android Articles‎ > ‎

TextView Style In Android

posted Jan 25, 2011, 2:33 AM by Thiyagaraaj M   [ updated Feb 1, 2011, 7:28 AM by Thiyagaraaj Mp ]
Change TextView Style in Android 

Add in Layout XML

<TextView android:id="@+id/Heading"
        style="@style/TitleTextViewStyle"
        android:text="Heading" />

Create style.xml file in values folder and add this code

<style name="TitleTextViewStyle">
        <item name="android:layout_width">fill_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textSize">25sp</item>
        <item name="android:textColor">#FFFFFF</item>
    </style>