不会显示单元格的附件类型。我尝试了cell.accessoryType
和cell.accessoryView
(带图片)。除了这一点,表视图工作正常。有什么建议?感谢
我的代码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *simpleTableIdentifier = @"SimpleTableItem";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:simpleTableIdentifier];
}
cell.textLabel.text = @"Hi";
cell.detailTextLabel.text = @"Hi again!";
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
答案 0 :(得分:0)
确保您的表格单元格宽度适合屏幕。您是以编程方式创建UITableView还是在nib中?如果以编程方式创建,请检查表视图的帧大小,也可以在此处共享代码。
答案 1 :(得分:0)
从xib
的{{1}} / storyboard
中选择配件类型。