iphone - 如何以编程方式设置标签字体

标签 iphone xcode

如何在 Xcode 4 中设置标签字体?

我试过了

mylabel.setfont = @"DBLCDTempBlack";

最佳答案

使用以下之一

[mylabel setFont:[UIFont systemFontOfSize:13]];
[mylabel setFont:[UIFont boldSystemFontOfSize:13]];//or use this
myLabel.font=[UIFont systemFontOfSize:13]];//or
 mylabel.font=[UIFont boldSystemFontOfSize:13]//or

[mylabel setFont:[UIFont fontWithName:@"DBLCDTempBlack" size:128.0]];

还有一些其他方法请参阅创建 UIFont 的开发人员文档

关于iphone - 如何以编程方式设置标签字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6568101/

相关文章:

ios - 在 Swift Bridging Header 中包含 Google Analytics

iphone - 如何确定哪个事件称为imageMoved :withEvent:forControlEvents?

iphone - 为什么此透明图像在设备上显示为白色背景?

ios - 从电话簿中获取的联系号码中删除空格

ios - 当应用程序在后台时,如何继续收听来自 googlecast 的事件?

ios - 在 UILabel 中设置文本(带有表情符号、特殊字符、链接),并且链接应该是可点击的

ios - Cocoapod : "The document could not be saved. The file doesn’ t exist"的 Xcode 错误

iphone - iOS - 禁用 UIDocumentInteractionController 选项按钮

xcode - 缺少营销图标 - iOS Cordova

较小屏幕上的 ios 自动布局问题