get View on Screen Y coordinate - Android User Interface

Android examples for User Interface:View Position

Description

get View on Screen Y coordinate

Demo Code


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

public class Main {
    public static float getScreenY(View v) {
        int[] loc = new int[2];
        v.getLocationOnScreen(loc);//from   w w w . j a  va 2 s.c o  m
        return loc[1];
    }
}

Related Tutorials