检测shapeDrawable内是否发生触摸事件

时间:2014-01-05 22:20:40

标签: android android-layout ontouchlistener shapedrawable

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

1 个答案:

答案 0 :(得分:2)

我得到了答案:

  sd.getBounds().contains(x, y)
相关问题