MKAnnotationView的不同字体 [英] Different font for MKAnnotationView

查看:153
本文介绍了MKAnnotationView的不同字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iPhone SDK地图上的标注气泡上,可以更改标题和字幕属性的字体。



我不满意标注泡泡,并希望与不同的字体去匹配我的应用程序的其余部分。但是,我还没有看到太多的提及,这让我担心它可能是不可能的。



我已经看到构建自定义地图注释标注教程,我想这样做是可行的。但是,如果可能的话,我希望改变字体的能力已经被构建到 MKAnnotationView 中了,就像我可以改变字体 UILabel

解决方案您需要使用 MKAnnotationView 或其子类,按照您的建议更改标题和字幕标签的外观。如果你想创建更多的可重用代码,我会继承子类并添加say属性来查询,并将 UIFont 值设置为 UILabel 实例。


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 bubble, and would like to go with a different font face to match the rest of my application. However, I have not seen much mention of this, which has me concerned that it might not be possible.

I have seen the Building Custom Map Annotation Callouts tutorial, and I guess that would work. But, if at all possible I was hoping that the ability to change a font was built into the MKAnnotationView much the same way I can change the font of a UILabel without subclassing it.

解决方案

You will need to use MKAnnotationView, or subclass it, to change the appearance of the title and subtitle labels as you suggest. If you want to create more re-usable code, I'd subclass and add say properties to query and set the UIFont values to your UILabel instances.

这篇关于MKAnnotationView的不同字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆