在Interface Builder中使用自定义字体设计标签/文本视图 [英] Designing labels/text views with custom fonts in Interface Builder

查看:172
本文介绍了在Interface Builder中使用自定义字体设计标签/文本视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个iPhone项目,其中所有标签/文本视图等都应该以自定义字体显示(我正在使用Xcode 4.2.1)。我已经做了一些研究,唯一的解决方案似乎是将字体文件添加到项目中,适当地编辑info.plist文件并以编程方式设置字体(即通过插座或通过继承相关视图)。在任何情况下,这些方法都不会导致界面生成器使用自定义字体显示文本(它仍然会显示Helvetica)。使用属性检查器来选择自定义字体是不可能的。



尽管我不认为我错过了一些东西,但我只是想确保没有其他方法比以编程方式设置字体,这将是一个相当痛苦的任务,我要工作(本地化问题,独特的应用程序设计等)。这将是很好的让界面生成器显示自定义字体..自定义字体只能以编程方式设置..不幸的是, ..这被称为接口生成器中的错误,尚未修复。

I am currently working on an iPhone project in which all labels/text views etc. should appear with a custom font (I'm using Xcode 4.2.1). I have done some research on this, and the only solution seems to be adding the font files to the project, editing the info.plist file appropriately and setting the font programmatically (i.e. by outlets or by subclassing the relevant views). In any case, these approaches won't lead to the interface builder displaying the text with the custom font (it will still show Helvetica). It is not possible to select the custom font using the attributes inspector.

Although I don't think I missed something, I just want to make sure there is no other way than programmatically setting the fonts, which would be a rather painful for the task I have to work on (localization issues, unique app design etc.). It would be nice to get the interface builder to display custom fonts..

解决方案

Custom fonts can only be set programmatically..Unfortunately..this is termed as a bug in interface builder and hasn't been fixed yet.

这篇关于在Interface Builder中使用自定义字体设计标签/文本视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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