【问题标题】:How implement the subtitle's update in mkannotationview after the tap on the corresponding annnotationview点击相应的annotationview后如何在mkannotationview中实现字幕的更新
【发布时间】:2012-08-01 08:36:44
【问题描述】:

就像googlemap的实现一样。
点击annotation view后,会显示callout气泡,然后获取网络获取一些信息。获取后,我们需要更新annotationview的字幕。
如何实现这个效果。非常感谢!

【问题讨论】:

  • 你能详细说明你的问题吗?你到底想要什么
  • 谢谢,我已经解决了这个问题。

标签: ios mkannotation mkannotationview subtitle


【解决方案1】:

KVO已经被annotation view实现了,你只需要实现 两个函数自己搞定:

@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *subtitle;

那么当你需要更改注解视图上的标题或副标题时

self.title = @"New title!";
[self setSubtitle:@"New subtitle!"];

然后会显示相应注释视图上的更新。

点击here,这就是答案,我对此表示感谢。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-16
    • 2016-10-05
    相关资源
    最近更新 更多