set TextView Typeface - Android User Interface

Android examples for User Interface:TextView Font

Description

set TextView Typeface

Demo Code


//package com.java2s;

import android.graphics.Typeface;

import android.view.View;

import android.widget.TextView;

public class Main {
    public static void setTypeface(View container, int id, Typeface face) {
        if (container == null)
            return;

        setTypeface(container.findViewById(id), face);
    }/*from  w  ww. ja  va 2s.  c  om*/

    public static void setTypeface(View textView, Typeface face) {
        ((TextView) textView).setTypeface(face);
    }
}

Related Tutorials