→ mamaya3:應該要等onLayout完才能確定位置吧 03/06 18:48
→ crazyma:恩恩 那有什麼方法可以確定onLayout跑完嗎 ~"~? 03/06 18:49
→ mamaya3:你override onLayout 那時的參數應該就有你要的資料了 03/06 18:52
→ JamesEX:View parent = (View)yourView.getParent(); 03/07 12:38
→ JamesEX:parent.post(new Runnable(){ 03/07 12:39
→ JamesEX:public void run() { 03/07 12:39
→ JamesEX:yourView.getHitRect(r) 03/07 12:40
→ JamesEX:這樣他就會que在parent結束後找rect 03/07 12:41
→ crazyma:喔喔 感謝J大 趕快來試試看XD 03/07 15:35