set Paint Text Under Line - Android Graphics

Android examples for Graphics:Paint

Description

set Paint Text Under Line

Demo Code


//package com.java2s;

import android.graphics.Paint;

import android.text.TextPaint;
import android.view.View;

import android.widget.TextView;

public class Main {

    public static void setTextUnderLine(View view) {
        if (null == view || !(view instanceof TextView)) {
            return;
        }/*from ww w .  j a  v  a  2 s  .c  o  m*/
        Paint paint = ((TextView) view).getPaint();
        paint.setFlags(TextPaint.ANTI_ALIAS_FLAG
                | TextPaint.UNDERLINE_TEXT_FLAG);
    }
}

Related Tutorials