TouchDelegate设置点击区域
要想控制点击区域的形状和大小需要TouchDelegate
final View parent = (View) delegate.getParent();?
parent.post( new Runnable() {?
?????? public void run() {?
? ? ? ? final Rect r = new Rect();?
? ? ? ? delegate.getHitRect(r);?
? ? ? ? r.top -= 4;?
? ? ? ? r.bottom += 4;?
? ? ? ? parent.setTouchDelegate( new TouchDelegate( r , delegate));?
? ? }?
});?
delegate为一个控件