【问题标题】:Detect touch on custom annotionVIew检测自定义注释上的触摸视图
【发布时间】:2014-04-12 00:47:19
【问题描述】:

如何在 (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 中检测自定义 annotationView 上的触摸?

我使用该代码,但它不起作用

[super touchesBegan:touches withEvent:event];
UITouch *touch = [touches anyObject];
if (touch.view == [CustomAnnotationView class])
{

【问题讨论】:

    标签: ios annotations android-mapview uigesturerecognizer


    【解决方案1】:

    您想检查触摸的视图是否是 CustomAnnotationView 类。

    [super touchesBegan:touches withEvent:event];
        UITouch *touch = [touches anyObject];
        if ([touch.view isKindOfClass:[CustomAnnotationView class]])
        {
    

    【讨论】:

    • 斯帕西博 4yvak, viry4il
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多