get View Target X Y - Android User Interface

Android examples for User Interface:View Position

Description

get View Target X Y

Demo Code


//package com.java2s;

import android.view.View;

public class Main {
    public static float[] getTargetXY(View view) {
        final float[] target = new float[2];
        target[0] = view.getX();// w w w  .  jav  a  2  s .com
        target[1] = view.getY();
        return target;
    }
}

Related Tutorials