简体   繁体   English

在MKAnnotation中添加额外的标题属性?

[英]Adding Extra Title Attributes to MKAnnotation?

Currently I have a subClass of MKAnnotation and I was wondering if its possible to add extra tile attributes. 目前,我有一个MKAnnotation的子类,我想知道是否可以添加额外的tile属性。 Currently MKAnnotation adds 目前,MKAnnotation添加了

  • Title 标题
  • Subtitle 字幕

Is there a way I could add two more lines / NSStrings to allow 4 lines of text? 有没有办法我可以再添加两行/ NSString以允许四行文本?

  • Title 标题
  • SubTitle 字幕
  • Location 位置
  • Date 日期

gary 加里

If you want the extra lines, you'll have to make your own version of an annotation view. 如果需要多余的行,则必须制作自己的注释视图版本。 There is some information about making a custom annotation view here: 这里有一些有关制作自定义注释视图的信息:

http://developer.apple.com/iphone/library/documentation/MapKit/Reference/MKAnnotationView_Class/Reference/Reference.html http://developer.apple.com/iphone/library/documentation/MapKit/Reference/MKAnnotationView_Class/Reference/Reference.html

The other thing you can do is to put the extra information together in the subtitle, or use one of the callout accessory views (for example, use icons to represent different locations or dates). 您可以做的另一件事是将额外的信息放在字幕中,或使用标注的附件视图之一(例如,使用图标代表不同的位置或日期)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM