2014-01-05 96 views
1

我在自定义的android视图中通过画布绘制了许多ShapeDrawables。我有一个onTouchEvent方法,它工作正常。一切工作正常。现在我希望能够检测触摸事件是否与某个ShapeDrawable相交(即发生在内部)。有没有办法做到这一点?检测触摸事件是否发生在shapeDrawable里

回答

2

我得到了答案:

sd.getBounds().contains(x, y)