gpt4 book ai didi

ios - 自定义 MKAnnotation

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:52:36 25 4
gpt4 key购买 nike

亲切的问候,

我正在使用下面的代码在 iOS 上显示注释 在 map 上点击时。

MKPointAnnotation *aAnnotationPoint = [[MKPointAnnotation alloc] init];

aAnnotationPoint.title = @"Virginia";
aAnnotationPoint.subtitle = @"This is a test code .this is a test code. This is a test codeThis is a test code .this is a test code. This is a test code";

// Add the annotationPoint to the map
[myMapView addAnnotation:aAnnotationPoint];

问题是注释没有完全显示文本 - 它用 ... 将其切断。这是结果:

enter image description here

我已经在互联网上搜索过这种样本,但没有成功。我怎样才能做到这一点?

最佳答案

默认情况下,calloutMKPointAnnotation 的大小与您在图片中显示的大小相同。由于字幕很长,字幕文本没有完全显示。

这个问题的解决方案是寻找 custom callouts from here 。也尝试从这个 wonderful tutorial 寻求帮助 将 UIBarButton 和 UIImageView 提供给 pinView。

希望你明白我的意思。祝你好运!

关于ios - 自定义 MKAnnotation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5113585/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com