get View Y Coordinate On Screen - Android User Interface

Android examples for User Interface:View Property

Description

get View Y Coordinate On Screen

Demo Code


//package com.java2s;

import android.view.View;

public class Main {
    public static int getYCoordOnScreen(View view) {
        int[] ints = new int[2];
        view.getLocationOnScreen(ints);//w  w  w  . ja v  a  2s .c o  m
        return ints[1];
    }
}

Related Tutorials