程序员

Android自定义控件知识点杂记

2016-11-30  本文已影响0人  Mr_step

自定义控件遇到的一些杂七杂八的知识点记录一下,避免忘记.

 Rect rect = new Rect();
 int[] location = new int[2];
 mTextView.getLocationOnScreen(location); 
rect.left = location[0]; rect.top = location[1]; 
rect.right = mTextView.getWidth() + location[0]; 
rect.bottom = mTextView.getHeight() + location[1];
if (rect.contains((int) event.getRawX(), (int) event.getRawY()))
 { 
        mTouch = true;
}

持续更新....

上一篇 下一篇

猜你喜欢

热点阅读