我UITableview
正在显示数据,但是一个部分中的文本正在移出框并显示在其他部分中..我不知道为什么?
这是我的代码:
if(indexPath.section == 0){
cell.textLabel.font = [UIFont boldSystemFontOfSize:14];
cell.textLabel.textColor = [UIColor blackColor];
cell.detailTextLabel.numberOfLines=3;
cell.detailTextLabel.textColor=[UIColor colorWithRed:0.40 green:0.40 blue:0.40 alpha:1.0];
cell.textLabel.text=[NSString stringWithFormat:@"School Hours:"];
cell.detailTextLabel.text=[NSString stringWithFormat:@"Take in time: %@ \nDissmiss time:%@ \nPhone No: %@ ",[array objectAtIndex:indexPath.row],[array1 objectAtIndex:indexPath.row],[array2 objectAtIndex:indexPath.row]];
cell.textLabel.backgroundColor=[UIColor clearColor];
cell.detailTextLabel.backgroundColor=[UIColor clearColor];
}
else if(indexPath.section == 1){cell.textLabel.font = [UIFont boldSystemFontOfSize:14];
cell.textLabel.textColor = [UIColor blackColor];
cell.detailTextLabel.numberOfLines=3;
cell.detailTextLabel.textColor=[UIColor colorWithRed:0.40 green:0.40 blue:0.40 alpha:1.0];
cell.textLabel.text=[NSString stringWithFormat:@"Principal"];
NSString *thumbs = [NSString stringWithFormat:@"%@", [imagearray objectAtIndex:indexPath.row]];
UIImage *thumbs1 = [UIImage imageWithData:[NSData dataWithContentsOfURL:
[NSURL URLWithString:thumbs]]];
// cell.imageView.image = [UIImage imageNamed:th];
cell.detailTextLabel.text=[NSString stringWithFormat:@" %@ ",[imagearray objectAtIndex:indexPath.row]] ;
cell.textLabel.backgroundColor=[UIColor clearColor];
cell.detailTextLabel.backgroundColor=[UIColor clearColor];}
任何人都可以让我知道出了什么问题。我什至为这些部分设置了页眉和页脚。