7
A
답변
15
당신은 아마 (특성 관리자에서 발견 할 수있는 코드 또는 인터페이스 빌더에서 중, 0으로 분리 세트를 설정 기본값은 왼쪽의 경우 15이고 오른쪽의 경우 0입니다.
+1
감사합니다! 나는 IB에서 그렇게하지 않았다. 그러나 나는 ""("self.tableView respondsToSelector : @selector (separatorInset)]) { [self.tableView setSeparatorInset : UIEdgeInsetsZero]; } – stackOverFlew
4
[UITableViewDelegate
의 코드를 게시 하시겠습니까? UITableView
, 섹션 헤더에이 인세 트를 설정할 수있는 API가 없으므로 UIView
을 tableView:viewForHeaderInSection:
에 반환하고 원하는 레이아웃을 설정할 수 있습니다.
- (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; }
크기 검사기로 이동하여 헤더 높이를 변경 했습니까? –
아니요, 시도했지만 도움이되지 않았습니다. 그래도 고마워! – stackOverFlew