我很高兴能够在我的iOS5应用程序中使用外观代理来自定义系统范围内的NavigationController UI元素,但是:
我的应用程序中有很多嵌套表格,其中我希望能够在所有表格单元格中更改字体。 它们主要是静态创建的。 我已经将一些单元格生成放入类中,从数组中读取,但主要问题在于我在Interface Builder中放入了大量内容部分。 IB似乎没有用于批量字体设置的选项。
我想知道是否有人可以帮我找到一种方法来设置所有的UITableCell字体?
也许是这样的:
[[UILabel appearance] setFont:[UIFont fontWithName:@"Times" size:17.00];I'm loving being able to use an appearance proxy in my iOS5 app to customise the NavigationController UI elements system-wide, however:
I have a lot of nested tables in my app, of which I'd love to be able to change the font across all table cells. They are mainly statically created. I've put some cell generation inside of a class, being read from an array, but the main issue lies with a large contents section I've tabled in Interface Builder. IB doesn't seem to have the option for mass-font setting.
I was wondering if anyone could help me find a way to set all the UITableCell fonts in one go?
Perhaps something like:
[[UILabel appearance] setFont:[UIFont fontWithName:@"Times" size:17.00];最满意答案
您可以使用appearanceWhenContainedIn:来缩小要为其设置外观的UIViews的范围。
在你的例子中,尝试:
[[UILabel appearanceWhenContainedIn:[UITableViewCell class], nil] setFont:[UIFont fontWithName:@"Times" size:17.00]];You can use appearanceWhenContainedIn: to narrow down which UIViews you'd like to set the appearance for.
In your example, try:
[[UILabel appearanceWhenContainedIn:[UITableViewCell class], nil] setFont:[UIFont fontWithName:@"Times" size:17.00]];更多推荐
发布评论