Android View Position Get getTop(View myView)

Here you can find the source of getTop(View myView)

Description

get Top

Declaration

public static int getTop(View myView) 

Method Source Code

//package com.java2s;

import android.view.View;

public class Main {
    public static int getTop(View myView) {
        if (myView.getParent() == myView.getRootView())
            return myView.getTop();
        else/*  w ww  . j  a v a 2  s  .c  o m*/
            return myView.getTop() + getTop((View) myView.getParent());
    }
}

Related

  1. getPositionForView(final AdapterView adapterView, final View view)
  2. getRelativeTop(View myView)