0

I want to set the style my sections in a UITableView like viewForFooterInSection or viewForHeaderInSection.

I only can set the title using titleForHeaderInSection and height using heightForHeaderInSection but I want to set the baground color, font-size, font-color, etc...

It's posible do that?

Sebastián Lara
  • 5,355
  • 2
  • 28
  • 21
  • Yes, create UIView and implement the `viewForHeaderInSection` and then return your view. – Nirav D Sep 16 '16 at 14:46
  • You can do whatever you want to your views for the section headers and footers. Please clarify what trouble you are having. Your questions isn't very clear. – rmaddy Sep 16 '16 at 14:46
  • Duplicated of: http://stackoverflow.com/questions/15611374/customize-uitableview-header-section?rq=1 – iDevzilla Sep 16 '16 at 16:03

1 Answers1

0

you can do it with this delegate method whic provide by apple.

//for header 
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
     UIView *myview = [[UIView alloc] init];
    //give size for veiw, background color, add label anything here



    return myview;
}


//for footer

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    UIView *myview = [[UIView alloc] init];
    //give size for veiw, background color, add label anything here



    return myview;
}
caldera.sac
  • 4,918
  • 7
  • 37
  • 69