我有一个Android视图,想要将其TouchDelegate的宽度增大。
private void expandDiscTouchArea() {
...
discOsbParent.post(() -> {
// Post in the parent's message queue to make sure the parent
// lays out its children before we call getHitRect()
Rect delegateArea = new Rect();
discOsb.getHitRect(delegateArea);
delegateArea.right += getResources().getDimensionPixelSize(R.dimen.disc_in_osb_extra_touch_area);
TouchDelegate expandedArea = new TouchDelegate(delegateArea, discOsb);
// give the delegate to an ancestor of the view we're delegating the area to
...
});
}
我看到只有一个选项可以更改touchArea right
,而不能更改end
。
有什么方法可以将触摸区域扩展到end
吗?