开发者

Get frontmost subview

I know UIView's hitTest:withEvent: method digs down to the far-most view that gets the touch event, but how would yo开发者_StackOverflow中文版u get the opposite result? The first view to get an event at a certain CGPoint?

EDIT As zem pointed out, that hitTest method returns the farthest descendent in the view hierarchy. In my case, I have a mapView with a bunch of pinViews on it and I wanna get the frontmost pin at a certain CGPoint. That hitTest method keeps returning MKAnnotationContainerView, which I assume is a UIView that contains all my pinViews. How do I make it return the pinView itself and not its furthest descendant?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜