Android View api 詳解 - getLeft , getTop, getBottom, getRight

概述 掌握getLeft , getTop, getBottom, getRight的關鍵點:他們的取值是相對於父View的相對位置,單位是dx 注意:以上方法在OnCreate方法中調用,都會返回0,這是因爲View還未加載完畢;本文點擊計算之後纔開始獲取View的getLeft , getTop, getBottom, getRight值。 源碼點擊此處下載
相關文章
相關標籤/搜索