[Could you post your UITableViewDelegate code? There is no API in UITableView for setting these attachments in the section header, so that you can return the custom UIView to tableView:viewForHeaderInSection: and then set the desired layout.
- (UIView *) tableView: (UITableView *) tableView viewForHeaderInSection: (NSInteger) section {
UIView * headerView = [UIView alloc] init];
UILabel * headerLabel = [UILabel alloc] init];
headerLabel.text = @ "xxx";
[headerLabel sizeToFit];
headerLabel.frame = CGRectMake (20, 0, CGRectGetWidth (headerLabel.frame), CGRectGetHeight (headerLabel.frame));
[headerView addSubview: headerLabel];
headerView.frame = CGRectMake (0, 0, CGRectGetWidth (tableView.bounds), CGRectGetHeight (headerLabel.frame));
return headerView;
}
Molicice
source share