TableView header issue

Discussion in 'iOS Programming' started by 99miles, Apr 6, 2009.

  1. macrumors member

    Joined:
    Oct 10, 2008
    #1
    I have a TableView of type: UITableViewStyleGrouped

    In viewForHeaderInSection I return a UILabel:

    UILabel* hdr = [[[UILabel alloc] initWithFrame:CGRectMake(40, 0, 280, 40)] autorelease];
    hdr.opaque = YES ;
    [hdr setTextColor:[UIColor whiteColor]];
    UIFont *textHeaderFont = [UIFont fontWithName:mad:"Arial-BoldMT" size:16];
    hdr.font = textHeaderFont;
    hdr.backgroundColor = [UIColor clearColor];
    hdr.text = @"title";
    return hdr ;

    ... but it is not indented. It's x location is 0.

    If I return a UITableViewCell the header is indented but there's about a 1 pixel white space just below it.

    I can't figure out how to solve either problem. Any ideas?
    Thanks!
     

Share This Page