我有一个MKPointAnnotation
作为注释添加到我的MKMapView
中。我可以设置其title
和subtitle
属性,但无法设置这些属性对应标签的字体。是否有方法可以在不创建自定义视图并将其添加到didSelectAnnotationView
中的情况下实现此操作?我尝试重写systemFontOfSize
等方法,但没有可靠的方法告诉我是否正在设置title
或subtitle
标签的字体。
@implementation UIFont (SytemFontOverride)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
+ (UIFont *)boldSystemFontOfSize:(CGFloat)fontSize
{
return [UIFont fontWithName:@"HelveticaNeue" size:20.0];
}
+ (UIFont *)systemFontOfSize:(CGFloat)fontSize
{
return [UIFont fontWithName:@"HelveticaNeue" size:15.0];
}
#pragma clang diagnostic pop
@end