相关疑难解决方法(0)

了解iOS中的NSXMLParser

我了解了当前的NSXMLParser.我阅读了很多教程,但没有人能告诉我它是如何工作的.StackOverflow上有一个教程?我的问题是我的应用程序中的KML读取结构,并使用MKMapView进行显示

我的Parser类看起来像:

#import <Foundation/Foundation.h>

@interface Parser : NSXMLParser

@property (nonatomic, strong) NSString *rowElementName; // this is the element name that identifies a new row of data in the XML
@property (nonatomic, strong) NSArray *attributeNames;  // this is the array of attributes we might want to retrieve for that element name
@property (nonatomic, strong) NSArray *elementNames;    // this is the list of sub element names for which we're retrieving values

@property (nonatomic, strong) NSMutableArray *items;    // after parsing, this is the …
Run Code Online (Sandbox Code Playgroud)

nsxmlparser mapkit mkannotationview ios

6
推荐指数
1
解决办法
4438
查看次数

如何使整个 MKPinAnnotationView 可点击,而不仅仅是正确的附件视图

在以下方法中MKMapViewDelegate

func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? {

    let pinAnnotationView = MKPinAnnotationView(annotation: annotation, reuseIdentifier: "")
    pinAnnotationView.rightCalloutAccessoryView = UIButton(type: .DetailDisclosure)
    pinAnnotationView.canShowCallout = true

    return pinAnnotationView
}
Run Code Online (Sandbox Code Playgroud)

如果我像上面那样做,那么整个视图都是可点击的:

在此处输入图片说明

除此以外:

func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? {

        let pinAnnotationView = MKPinAnnotationView(annotation: annotation, reuseIdentifier: "")
        let accessoryView = UIButton(frame: CGRectMake(0, 0, 25, 25))
        accessoryView.setImage(UIImage(named: "icon-menu"), forState: .Normal)

        pinAnnotationView.rightCalloutAccessoryView = accessoryView
        pinAnnotationView.canShowCallout = false

        return pinAnnotationView
}
Run Code Online (Sandbox Code Playgroud)

只有右附件视图被点击,为什么?

问题是。怎么做才能使整体可点击MKPinAnnotationView而不仅仅是正确的披露?

mapkit ios swift

4
推荐指数
1
解决办法
462
查看次数

在MKPointAnnotation上注册触摸事件

我想设置一个MKPointAnnotation,当它被点击时,我可以调用另一个功能.反正有没有添加手势识别器或类似的东西?

mapkit swift

3
推荐指数
1
解决办法
1557
查看次数

iOS自定义注释:注释引脚下方的视图

我需要用我的自定义注释视图替换默认注释视图.

我需要做以下事情:

  1. 自定义注释视图,其中嵌入了图像视图.
  2. 它下面的视图,其中包含一个标签.

有关更多说明,请参阅图像:

样品针

在上面的图像中,我需要在图像中以圆形形式显示白色空间中的图像视图,接下来我还需要添加一个包含标签的视图,我可以在其上设置任何文本,如我,朋友,等等...

所以,为此,我搜索了关于堆栈溢出的问题,但没有得到我的答案.我不希望它在呼出时,我只是想在渲染地图时将其简单地作为注释.我试图为此制作一个自定义类,但不知道如何处理这个.

任何帮助将受到高度赞赏

objective-c mapkit ios mapkitannotation

3
推荐指数
1
解决办法
2933
查看次数