Android examples for User Interface:View Property
get View Relative Left
//package com.java2s; import android.view.View; public class Main { public static int getRelativeLeft(View myView) { if (myView.getParent() == myView.getRootView()) return myView.getLeft(); else/*from w w w .ja va2 s. com*/ return myView.getLeft() + getRelativeLeft((View) myView.getParent()); } }