Different font for MKAnnotationView

前端 未结 2 1722
温柔的废话
温柔的废话 2021-02-11 04:14

On the callout bubble on the iPhone SDK\'s map, can the font be changed for the title and subtitle properties.

I am displeased with the default font shown in the callout

2条回答
  •  孤街浪徒
    2021-02-11 04:25

    Subclass the MKAnnotationView then put the category below on top of its implementation:

    @implementation UIFont (SytemFontOverride)
    
    #pragma clang diagnostic push
    #pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
    
    + (UIFont *)boldSystemFontOfSize:(CGFloat)fontSize {
    
        return [UIFont fontWithName:@"Your-Font-Here" size:fontSize];
    }
    
    + (UIFont *)systemFontOfSize:(CGFloat)fontSize {
    
        return [UIFont fontWithName:@"Your-Font-Here" size:fontSize];
    }
    
    #pragma clang diagnostic pop
    
    @end
    

提交回复
热议问题