Jon*_*nny 51 fonts interface-builder ios
所以我们在2014年,有没有办法在Interface Builder中设置自定义字体?即不要以编程方式执行,除了应用程序的plist中的"应用程序提供的字体".
Asi*_*lal 70
是的,Marrius是对的.在Xcode 6中,您既不需要使用额外的软件也不需要在代码文件中设置Font.只需在项目中添加字体文件以及其他文件即可."界面"构建器将在"自定义字体列表"中显示添加的字体.
最令人惊奇的是,xcode 6在IB中立即显示应用的字体.这是Apple的重要补充.
还要确保在项目的info.plist中添加此键"应用程序提供的字体",并提供字体文件名以查看设备中的效果.
小智 14
在Xcode 6中,我们在界面构建器中提供了自定义字体.
无需额外的软件.谢谢Apple!
小智 9
在Xcode 6中,只需在项目中添加ttf文件,并通过自定义字体在故事板中使用它.如果你直接想在你的代码中使用它而不在storyboard中使用它,那么你必须在projectName-Info.plist中添加关键的"UIAppFonts".
例:
<key>UIAppFonts</key>
<array>
<string>Signika-Bold.ttf</string>
<string>Signika-Regular.ttf</string>
<string>Signika-Light.ttf</string>
<string>Signika-Semibold.ttf</string>
</array>
Run Code Online (Sandbox Code Playgroud)
就</dict>在projectName-Info.plist中的行之前.
UIFont* font = [UIFont fontWithName:@"Signika-Regular" size:25];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
21875 次 |
| 最近记录: |