你创建了一个
TouchDelegate:
final View parent = (View) findViewById(R.id.touch_delegate_root);
parent.post( new Runnable() {
// Post in the parent's message queue to make sure the parent
// lays out its children before we call getHitRect()
public void run() {
final Rect rect = new Rect();
Button delegate = YourActivityClass.this.mButton;
delegate.getHitRect(rect);
rect.top -= 20;
rect.bottom += 12; // etc
parent.setTouchDelegate( new TouchDelegate( rect , delegate));
}
});