【发布时间】:2012-08-04 01:25:32
【问题描述】:
在尝试将 UIAppearance 代理样式应用于 UILabel 类代理时,我得到了不可靠的结果。例如,以下工作符合我的预期:
[[UILabel appearance] setFont:[UIFont fontWithName:SOME_FONT size:SOME_SIZE]];
[[UILabel appearance] setShadowColor:[UIColor blackColor]];
设置 textColor 不起作用,但是,这个:
[[UILabel appearance] setColor:[UIColor greenColor]];
确实有效。 一种。这有点不可靠,并且会导致任何对 setTextColor: 的特定于实例的调用都被忽略。
将 UIAppearance 样式应用于 UILabel 的正确方法是什么?
【问题讨论】:
标签: ios uilabel uiappearance