什么';IOS6和IOS7中的UITableView的差异
我正在开发一个使用什么';IOS6和IOS7中的UITableView的差异,ios,objective-c,uitableview,ios6,ios7,Ios,Objective C,Uitableview,Ios6,Ios7,我正在开发一个使用UITableView的应用程序。此tableview由不同的部分组成。当你点击一行的时候。tableviewCells高度正在更改,因此看起来您正在展开该行 请看下面的屏幕截图 我开始为IOS7开发,在那里一切都很好。但现在我需要该应用程序也兼容IOS6。当我往那边看时,我看到了以下几点: 奇怪的是,当我向下滚动,然后再向上滚动。一切都恢复正常了。 有人能帮我解决这个问题吗 编辑 My CellForRowAtIndex - (UITableViewCell *)t
UITableView
的应用程序。此tableview由不同的部分组成。当你点击一行的时候。tableviewCells
高度正在更改,因此看起来您正在展开该行
请看下面的屏幕截图
我开始为IOS7开发,在那里一切都很好。但现在我需要该应用程序也兼容IOS6
。当我往那边看时,我看到了以下几点:
奇怪的是,当我向下滚动,然后再向上滚动。一切都恢复正常了。
有人能帮我解决这个问题吗
编辑
My CellForRowAtIndex
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"RelationCell";
RelationCell *cell = (RelationCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"RelationCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
cell.delegationListener = self;
cell.lblGSM2.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblGSM.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblAddress.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblAddress2.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblPhone.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblPhone2.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblNaam.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblNaam2.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblBTW.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblBTW2.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblEmail.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
[cell.lblEmail2.titleLabel setFont:[UIFont fontWithName:@"MyriadPro-Regular" size:14]];
cell.lblFax.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblFax2.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblTel.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblTel2.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblURL.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblURL2.font = [UIFont fontWithName:@"MyriadPro-Regular" size:14];
cell.lblOmzet.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblOmzet2.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblSaldo.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblSaldo2.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblLevGSM.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblLevGSM2.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblVervallen.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblVervallen2.font = [UIFont fontWithName:@"MyriadPro-Regular" size:12];
cell.lblNaam2.textColor = [UIColor lightGrayColor];
cell.lblAddress2.textColor = [UIColor lightGrayColor];
cell.lblGSM2.textColor = [UIColor lightGrayColor];
cell.lblPhone2.textColor = [UIColor lightGrayColor];
cell.viewBack.backgroundColor = [UIColor colorWithRed:245 / 255.0 green:245 / 255.0 blue:245 / 255.0 alpha:1.0];
}
Relation *relation;
relation = [self.fetchedResultsController objectAtIndexPath:indexPath];
cell.relation = relation;
if([relation.rel_email isEqualToString:@""]){
cell.btnMail.hidden = YES;
}
cell.lblNaam.text = [NSString stringWithFormat:@"%@ - %@",relation.rel_name,relation.rel_code];
if(![relation.rel_address isEqualToString:@""]){
cell.lblAddress.text = [NSString stringWithFormat:@"%@, %@ %@",relation.rel_address,relation.rel_zipcode,relation.rel_city];
}else{
cell.lblAddress.text = [NSString stringWithFormat:@"%@ %@",relation.rel_zipcode,relation.rel_city];
}
cell.lblGSM.text = relation.rel_gsm;
cell.lblLevGSM2.text = relation.rel_gsm;
cell.lblPhone.text = relation.rel_phone;
cell.lblTel2.text = relation.rel_phone;
cell.lblFax2.text = relation.rel_fax;
cell.lblURL2.text = relation.rel_website;
if(![relation.rel_vat_number isEqualToString:@""]){
cell.lblBTW2.text = [NSString stringWithFormat:@"%@%@",relation.rel_vat_country_code,relation.rel_vat_number];
}
NSMutableAttributedString *mailString = [[NSMutableAttributedString alloc] initWithString:relation.rel_email];
[mailString addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(0, [mailString length])];
[mailString addAttribute:NSForegroundColorAttributeName value:[UIColor blueColor] range:NSMakeRange(0, [mailString length])];
[cell.lblEmail2 setAttributedTitle:mailString forState:UIControlStateNormal];
[cell.lblEmail2 setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
[formatter setCurrencySymbol:@""];
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"it_IT"];
[formatter setLocale:locale];
cell.lblVervallen2.text = [NSString stringWithFormat:@"%@ €",[formatter stringFromNumber:relation.rel_expired_total]];
cell.lblSaldo2.text = [NSString stringWithFormat:@"%@ €",[formatter stringFromNumber:relation.rel_balanceTotal]];
cell.lblOmzet2.text = [NSString stringWithFormat:@"%@ €",[formatter stringFromNumber:relation.rel_turnovertotal]];
return cell;
}
你能发布你的
cellforrowatinexpath
方法吗?@Malloc你能检查我的编辑吗?从屏幕截图上看不出什么,因为它们看起来一点都不相似,所以很难知道比较什么。但看起来你的细胞管理有点混乱——可能是加载了错误的细胞,可能是细胞中的视图放错了位置。(虽然可能是因为我称之为“口吃”的原因)当绘图被弄脏时。这与上/下滚动清理一致。不幸的是,我记不起是什么原因导致了这种现象。)