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
How can I change the font size of my UITableView cell title?
提问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.font
in your tableView:cellForRowAtIndexPath
method.
如果您以编程方式执行此操作,则可以cell.textLabel.font
在tableView: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 并使用您想要的大小分配标签。