get View Center Y - Android User Interface

Android examples for User Interface:View Center

Description

get View Center Y

Demo Code


//package com.java2s;
import android.view.View;

public class Main {
    public static float getCenterY(View view) {
        if (view != null) {
            return view.getY() + view.getHeight() / 2.0f;
        }/*from w  w w.  j a  v a2 s.c  om*/
        return 0;
    }
}

Related Tutorials