Android examples for User Interface:View Property
get View Bounds as RectF
//package com.java2s; import android.graphics.RectF; import android.view.View; public class Main { public static RectF getViewBounds(View view) { int location[] = new int[2]; view.getLocationOnScreen(location); int viewX = location[0]; int viewY = location[1]; return new RectF(viewX, viewY, viewX + view.getWidth(), viewY + view.getHeight());/*from ww w. jav a2 s. c om*/ } }