【发布时间】:2013-09-26 15:23:32
【问题描述】:
这是我创建单元格的代码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *cellIdentifier = @"cellIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (!cell)
{
cell = [[[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil] lastObject];
}
UIImageView * imageView = (UIImageView *)[cell viewWithTag:1];
imageView.image = [UIImage imageNamed:@"nature.jpg"];
UILabel *nameLabel = (UILabel *)[cell viewWithTag:2];
nameLabel.text = @"Some text";
UILabel *priceLabel = (UILabel*)[cell viewWithTag:3];
priceLabel.text = [_prices objectAtIndex:indexPath.row];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
我从笔尖创建它:
但iOS 7 和iOS 6 有区别,请看下面的截图:
【问题讨论】:
-
我在 iOS 6 和 iOS 7 上的单元格显示方式也有多个问题。不知道如何修复它们。也许苹果会做一些事情来解决这些问题。分组表在 iOS 7 上的显示方式也不同。有人找到修复方法了吗?
-
@benyboariu 你的问题解决了吗?
-
不,还没有解决方案。
-
@benyboariu 我已经回答了我的问题,你可以检查一下。也许它会帮助你。
标签: ios6 uitableview ios7 xib