Ios6 UITableViewCell问题。显示iOS 7和iOS 6的差异
这是我创建单元格的代码:Ios6 UITableViewCell问题。显示iOS 7和iOS 6的差异,ios6,uitableview,ios7,xib,Ios6,Uitableview,Ios7,Xib,这是我创建单元格的代码: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *cellIdentifier = @"cellIdentifier"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdent
- (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;
}
我从nib创建它:
但iOS 7和iOS 6之间存在差异请看下面的屏幕截图:
我已经设置了单元格高度的值。默认情况下,我没有使用此方法,这会导致我上面描述的问题
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 65.0f;
}
我还对iOS 6和iOS 7上单元格的显示方式存在多个问题。不知道如何修复它们。也许苹果会采取一些措施来解决这些问题。分组表在iOS 7上的显示方式也不同。有人找到解决办法吗?@benyboariu你的问题解决了吗?没有,还没有解决办法。@benyboariu我已经回答了我的问题,你可以检查一下。也许对你有帮助。