テーブルビューセクションのテキストの位置を変更するにはどうすればよいですか?私はviewForHeaderInSection:Sectionを使用し、そこに次のようなものを作成します。
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 300, 30)];
label.backgroundColor = [UIColor blackColor];
label.textColor = [UIColor whiteColor];
label.font = [UIFont fontWithName:@"Gotham-Bold" size:17.0f];
id <NSFetchedResultsSectionInfo> sectionInfo = [[self.comlpetedFetchedResultsController sections] objectAtIndex:section];
label.text = [@" " stringByAppendingString:[sectionInfo name]];
return label;
}
UILabelフレームのパラメーターのサイズは関係ありません。常に同じ結果が得られます。
UILabelのテキストを垂直方向に中央揃えするにはどうすればよいですか?ありがとう