【发布时间】:2012-02-16 10:08:53
【问题描述】:
我正在尝试为背景视图中的每个标签添加阴影:
[[UILabel appearanceWhenContainedIn:[MyBackgroundView class], nil] setShadowColor:[UIColor colorWithWhite:0.6 alpha:1]];
[[UILabel appearanceWhenContainedIn:[MyBackgroundView class], nil] setShadowOffset:CGSizeMake(0, -1)];
问题在于,在我的背景视图中有一些子视图(例如 tableview),哪些单元格的标签应该不获得这个 shadowColor。
我这样做了:
[[UILabel appearanceWhenContainedIn:[MyBackgroundView class], nil] setShadowColor:[UIColor colorWithWhite:0.6 alpha:1]];
[[UILabel appearanceWhenContainedIn:[MyBackgroundView class], nil] setShadowOffset:CGSizeMake(0, -1)];
[[UILabel appearanceWhenContainedIn:[UITableViewCell class], nil] setShadowColor:[UIColor clearColor]];
但是文本阴影仍然存在于表格视图的单元格中。
谁能告诉我我做错了什么?!?
【问题讨论】:
标签: ios shadow appearance