相关疑难解决方法(0)

如何从常规UIFont创建粗体UIFont?

如果我有一个UIFont对象,是否可以将其转换为粗体?我不知道字体名称,我只有一个UIFont对象.我想要的是一个像这样的功能

UIFont *boldFontFromFont(UIFont *input)
{
    return [input derivedFontWithFontWeight:UIFontWeightBold];
}
Run Code Online (Sandbox Code Playgroud)

如何更改代码以使其正常工作.(上面的代码不起作用,我只是说明了这一点.)

提前致谢.

uikit ios ios5

29
推荐指数
5
解决办法
2万
查看次数

UILabel - 在iPhone中以编程方式设置字体 - 字体

我的应用程序中有以下代码.

tmp=[[UILabel alloc] initWithFrame:label1Frame];
tmp.tag=1;
tmp.textColor=[UIColor blackColor];
[tmp setFont:[UIFont fontWithName:@"American Typewriter" size:18]];
tmp.backgroundColor=[UIColor clearColor];
[cell.contentView addSubview:tmp];
[tmp release];
Run Code Online (Sandbox Code Playgroud)

现在,我需要知道,

======>如何通过代码设置"Typeface = bold"?

iphone uilabel

28
推荐指数
3
解决办法
8万
查看次数

标签 统计

ios ×1

ios5 ×1

iphone ×1

uikit ×1

uilabel ×1