【发布时间】:2023-03-16 14:52:01
【问题描述】:
如何在 UITableView 单元格的部分标题中添加一些填充?
我有这个:
我有一个 NSDictionary,它的键值包含一串时间。我将键值存储在 NSArray 中。
我使用的是 titleForHeaderInSection 而不是 viewForHeaderInSection。
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
return [schedule objectAtIndex:section];
}
但是,节标题一直向左对齐。我可以根据自己的喜好使用 UIView for viewForHeaderInSection,但是对于 titleForHeaderInSection 方法有什么办法吗?
【问题讨论】:
标签: ios objective-c xcode