概述
View 是很多控件的父类,因此掌握了 View api 有助于掌握其它控件。
掌握LocationInWindow,getLocationOnScreen,getGlobalVisibleRect,getLocalVisibleRect的关键点:获得View在屏幕中的绝对位置。
getLocationInWindow,getLocationOnScreen,getGlobalVisibleRect,getLocalVisibleRect
getLocationInWindow
int[] position = new int[2];
textview.getLocationInWindow(pos