2016-05-17 51 views
1

字体大小如何更改MKAnnotation标题和副标题这是我的代码我怎样才能改变MKAnnotation标题和副标题

Newclass *ann1 = [[Newclass alloc] init]; 
ann1.title = namef1; 
ann1.subtitle = @""; 
ann1.coordinate = place1.center; 
[mapView addAnnotation: ann1]; 

我搜索使用

UIFont *size = [UIFont systemFontOfSize:17]; 
CGSize textsize = [ann1.title sizeWithAttributes:@{NSFontAttributeName:size}]; 

但建立这个代码,它显示未使用的可变文字大小

+0

有改变注释的标注的标题/字幕字体没有内置的规定。 – matt

回答

0

MKAnnotationMKAnnotationView之间有明显的区别。您将无法自定义订阅MKAnnotationProtocol的对象,因为您希望这样做,因为MKAnnotation协议只会要求对象维护变量以存储稍后将由MKAnnotationView对象绘制的信息。

我建议您编写一个自定义MKAnnotationView子类,其中包含自定义字体,其他任何其他适用于您希望注释的外观的子类。

This tutorial might help you out.

+0

这个答案对你有帮助吗? – achi

相关问题