Jul 5, 2015

Example to set textAppearance in XML

Example to set textAppearance in XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.example.androidtextappearance.MainActivity" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="android-coding.blogspot.com"
        android:textSize="24dp"
        android:textStyle="bold" />
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="textAppearance"
        android:textAppearance="?android:textAppearance" />
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="textAppearanceLarge"
        android:textAppearance="?android:textAppearanceLarge" />
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="textAppearanceMedium"
        android:textAppearance="?android:textAppearanceMedium" />
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="textAppearanceSmall"
        android:textAppearance="?android:textAppearanceSmall" />
    
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="textAppearanceInverse"
        android:textAppearance="?android:textAppearanceInverse" />
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="textAppearanceLargeInverse"
        android:textAppearance="?android:textAppearanceLargeInverse" />
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="textAppearanceMediumInverse"
        android:textAppearance="?android:textAppearanceMediumInverse" />
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="textAppearanceSmallInverse"
        android:textAppearance="?android:textAppearanceSmallInverse" />

 <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/darker_gray"
        android:text="textAppearanceInverse"
        android:textAppearance="?android:textAppearanceInverse" />
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/darker_gray"
        android:text="textAppearanceLargeInverse"
        android:textAppearance="?android:textAppearanceLargeInverse" />
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/darker_gray"
        android:text="textAppearanceMediumInverse"
        android:textAppearance="?android:textAppearanceMediumInverse" />
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/darker_gray"
        android:text="textAppearanceSmallInverse"
        android:textAppearance="?android:textAppearanceSmallInverse" />
    
</LinearLayout>



No comments:

Post a Comment

Infolinks In Text Ads