ios 如何更改 UITableView 单元格标题的字体大小?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7957215/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 22:08:17  来源:igfitidea点击:

How can I change the font size of my UITableView cell title?

iphoneobjective-ciosxcodeuitableview

提问by pixelbitlabs

How can I change the font size of my UITableView cell title in XCode?

如何在 XCode 中更改 UITableView 单元格标题的字体大小?

Thanks

谢谢

回答by Jonathan Ellis

If you are doing this programatically, then you can set the property cell.textLabel.fontin your tableView:cellForRowAtIndexPathmethod.

如果您以编程方式执行此操作,则可以cell.textLabel.fonttableView:cellForRowAtIndexPath方法中设置该属性。

Specifically, to change the size, you would write:

具体来说,要更改大小,您可以编写:

 cell.textLabel.font = [UIFont systemFontOfSize:12.0];

Which would resize your font to size 12.0 pts.

这会将您的字体大小调整为 12.0 pts。

回答by Owen Hartnett

Use a custom UITableViewCell and assign labels using the sizes you want.

使用自定义 UITableViewCell 并使用您想要的大小分配标签。