这些“管道”字符出现在我的表格视图的某些单元格中,但仅在 iOS 6 上。第一个屏幕截图显示了 iOS 6 上的问题,下面的屏幕截图是 iOS 4.3:
我感谢提供的任何帮助。
这是我正在使用的代码:
- (UITableViewCell *)tableView:(UITableView *)_tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *CellIdentifier = [NSString stringWithFormat:@"Cell%d%d", indexPath.section, indexPath.row];
UITableViewCell *cell = [_tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
UIView *clearColor = [[UIView alloc] init];
clearColor.backgroundColor = [UIColor clearColor];
cell.selectedBackgroundView = clearColor;
}
UILabel *label1 = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 243.5, 25)];
[label1 setFont:[UIFont fontWithName:@"Helvetica-Bold" size:16.0]];
[label1 setTextColor:[UIColor blackColor]];
label1.text = [[self.tableDataSource objectAtIndex:indexPath.row] objectForKey:@"Name"];
[cell addSubview:label1];
UILabel *label2 = [[UILabel alloc]initWithFrame:CGRectMake(253.5, 10, 243.5, 25)];
[label2 setFont:[UIFont fontWithName:@"Helvetica-Bold" size:16.0]];
[label2 setTextColor:[UIColor blackColor]];
label2.text = [[self.tableDataSource objectAtIndex:indexPath.row] objectForKey:@"Email"];
[cell addSubview:label2];
UILabel *label3 = [[UILabel alloc]initWithFrame:CGRectMake(507, 10, 243.5, 25)];
[label3 setFont:[UIFont fontWithName:@"Helvetica-Bold" size:16.0]];
[label3 setTextColor:[UIColor blackColor]];
label3.text = [[self.tableDataSource objectAtIndex:indexPath.row] objectForKey:@"Phone"];
[cell addSubview:label3];
UILabel *label4 = [[UILabel alloc]initWithFrame:CGRectMake(760.5, 10, 243.5, 25)];
[label4 setFont:[UIFont fontWithName:@"Helvetica-Bold" size:16.0]];
[label4 setTextColor:[UIColor blackColor]];
label4.text = [[self.tableDataSource objectAtIndex:indexPath.row] objectForKey:@"Business"];
[cell addSubview:label4];
return cell;
}
点击查看大图