get Screen Y location - Android User Interface

Android examples for User Interface:Screen Position

Description

get Screen Y location

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);//  www. j  av a  2 s  .co  m
        return loc[1];
    }
}

Related Tutorials