How to change font color of the title in grouped type UITableView?

前端 未结 6 1572
轮回少年
轮回少年 2020-12-13 03:55

I have a grouped type table view and it looks pretty cool.

But, if I change the background color of the table to black, the titles becomes unclear.

Is it pos

6条回答
  •  一整个雨季
    2020-12-13 04:29

    From apple documentation

    The table view uses a fixed font style for section header titles. If you want a different font style, return a custom view (for example, a UILabel object) in the delegate method tableView:viewForHeaderInSection: instead.

    So use the below method and return your custom view (UILabel) with your choice of font.

    - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
    

    Read from apple documentation

提交回复
热议问题