Android examples for User Interface:View Center
get View Center Position
//package com.java2s; import android.view.View; public class Main { public static float[] getViewCenterPosition(View v) { float x = v.getX() + v.getWidth() / 2; float y = v.getY() + v.getHeight() / 2; float[] ret = { x, y }; return ret; }/*www. j av a 2s . co m*/ }