UITableView header/footer font color

后端 未结 2 1680
走了就别回头了
走了就别回头了 2020-12-23 17:46

When overriding the header/footer of a (group styled) table view, what colour should be used for the header and footer fonts to ensure the header and footer fonts are consis

相关标签:
2条回答
  • 2020-12-23 18:19

    From this discussion

    Here's the UILabel info for tableView headers on iOS 6:

    Plain
    fontName: Helvetica-Bold
    pointSize: 18.000000
    textColor: UIDeviceWhiteColorSpace 1 1
    shadowColor: UIDeviceWhiteColorSpace 0 0.44
    shadowOffset: CGSize 0 1
    
    
    Grouped
    fontName: Helvetica-Bold
    pointSize: 17.000000
    textColor: UIDeviceRGBColorSpace 0.298039 0.337255 0.423529 1
    shadowColor: UIDeviceWhiteColorSpace 1 1
    shadowOffset: CGSize 0 1
    

    As for the background of the plain style header, that's a UIImage, not simply a backgroundColor. Notice the subtle vertical gradient.

    hope it helps

    0 讨论(0)
  • 2020-12-23 18:33

    This works for me (for the footer), with some fiddling of the CGFrame of the label, and its numberOfLines it might work for you to:

    int height = [self tableView:table heightForFooterInSection:section];
    
    UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(0, 0, table.bounds.size.width - 20, height)] autorelease];
    label.text              = [self tableView:table titleForFooterInSection:section];
    label.textColor         = [UIColor colorWithRed:0.298 green:0.337 blue:0.423 alpha:1.000];
    label.font              = [UIFont systemFontOfSize:15.0];
    label.backgroundColor   = [UIColor clearColor];
    label.shadowColor       = [UIColor whiteColor];
    label.shadowOffset      = CGSizeMake(0, 1);
    label.textAlignment     = UITextAlignmentCenter;
    label.numberOfLines     = 2;
    
    0 讨论(0)
提交回复
热议问题