MKAnnotationView 的不同字体
在iPhone SDK地图上的标注气泡上,可以更改标题和副标题属性的字体吗?
我对标注气泡中显示的默认字体不满意,并且希望使用不同的字体来匹配我的应用程序的其余部分。然而,我没有看到太多提及这一点,这让我担心这可能是不可能的。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对 MKAnnotationView 进行子类化,然后将下面的类别放在其实现之上:
Subclass the MKAnnotationView then put the category below on top of its implementation:
您将需要使用 MKAnnotationView 或其子类,按照您的建议更改标题和副标题标签的外观。如果您想创建更多可重用的代码,我会子类化并添加 say 属性来查询并将
UIFont
值设置为您的UILabel
实例。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 theUIFont
values to yourUILabel
instances.