get TextView Center Y - Android User Interface

Android examples for User Interface:TextView

Description

get TextView Center Y

Demo Code


//package com.java2s;

import android.widget.TextView;

public class Main {
    public static float getTextViewCenterY(TextView textView) {
        float y = (textView.getTop() + textView.getBottom()) / 2;
        return y;
    }//w ww .  j a  v  a2  s  . c  o  m
}

Related Tutorials