Search code examples
uitableviewheaderstylesfooternsattributedstring

iOS: What is the grouped tableView header/footer text default style


This problem sometimes bothers me a lot. For example, if I just want to change the header text font size, I have to create the whole UIView. There is no direct instance method for UITableView like [tableView setHeaderTextFont], I think apple should really add this method.

However, this post did a good job, but it's not exactly the same with the original one. If you check the original one very careful, it has effect like 'inner glow' in photoshop, but with NSAttributedString, this can not be done (correct me if I'm wrong). It must be rendered by some private methods.

Also, the footer text style is the same.

So my question is: how to recreate the grouped tableview header/footer text style, exactly.

Thanks.


Solution

  • The effect you're talking about is just a 1px white shadow. It's there in the post you linked to:

    label.shadowColor = [UIColor colorWithWhite:1.0 alpha:1];
    label.shadowOffset = CGSizeMake(0, 1);
    

    Are you implementing this and not seeing the effect?