【发布时间】:2012-06-13 17:08:10
【问题描述】:
我正在尝试开发一个 UITableView,它具有 sectionIndexTitles 并且哪些单元格具有辅助按钮。
问题是索引标题的滚动条减小了单元格的宽度,因此附件按钮的位置很丑......
是否可以将按钮稍微向左移动以使其位于单元格内?
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier];
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.textLabel.text = @"text";
}
return cell;
}
如你所见,我不操纵单元格或类似的东西。
在这里你可以看到结果:
【问题讨论】:
-
实际上我操纵了没有额外自定义行的代码(我已经在没有这些的情况下对其进行了测试 -> 相同的结果)
标签: ios ipad uitableview accessorytype