什么是字体大小,字体颜色,阴影颜色和UITableView部分标题中的偏移量?

时间:2011-09-02 09:38:31

标签: iphone ios ipad

我正在使用自定义图形重现原始的UITableView部分标题。

字体大小,字体颜色,阴影颜色和颜色是多少? UITableView部分标题中的偏移量?

感谢。

3 个答案:

答案 0 :(得分:1)

试试这个公式:

headerLabel.font = [UIFont boldSystemFontOfSize:17];
headerLabel.shadowColor = [UIColor colorWithWhite:1.0 alpha:1.0];
headerLabel.shadowOffset = CGSizeMake(0, 1);
headerLabel.textColor = [UIColor colorWithRed:0.265 green:0.294 blue:0.367 alpha:1.0];

答案 1 :(得分:0)

UILabel * headerLabel = [[UILabel alloc] initWithFrame:CGRectZero];
headerLabel.backgroundColor = [UIColor clearColor];
headerLabel.opaque = NO;
headerLabel.textColor = [UIColor blackColor];
headerLabel.highlightedTextColor = [UIColor whiteColor];
headerLabel.font = [UIFont boldSystemFontOfSize:20];
headerLabel.frame = CGRectMake(10.0, 0.0, 300.0, 44.0);

希望这能满足您的要求......

答案 2 :(得分:0)

如果你的意思是iOS7之前的外观,我的结果很好:

UITableViewHeaderFooterView *headerView = [[UITableViewHeaderFooterView alloc] init];
headerView.textLabel.text = title;
headerView.textLabel.textColor = [UIColor whiteColor];
headerView.textLabel.shadowColor = [UIColor colorWithRed:0.40 green:0.42 blue:0.43 alpha:1.0];
headerView.textLabel.shadowOffset = CGSizeMake(0, 1);

如果你没有使用UITableViewHeaderFooterView,那么创建一个作为测试并获取其标签的其他属性(字体等)。