IOS UITableViewCell内容不可用';不完全显示或不显示';t显示
当我将红色部分设置在顶部单元格上时,下一部分(绿色部分)的内容不会完全显示或不显示。只有当我选择绿色部分时,图像才会显示。如果我将绿色部分的一个单元格放在红色部分上方,它将显示,而红色部分下方的下一部分不会显示IOS UITableViewCell内容不可用';不完全显示或不显示';t显示,ios,uitableview,cell,Ios,Uitableview,Cell,当我将红色部分设置在顶部单元格上时,下一部分(绿色部分)的内容不会完全显示或不显示。只有当我选择绿色部分时,图像才会显示。如果我将绿色部分的一个单元格放在红色部分上方,它将显示,而红色部分下方的下一部分不会显示 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if(indexPath.section == 0) {
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if(indexPath.section == 0) {
static NSString *identifyCell = @"TopCell";
TopTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifyCell];
if (!cell) {
cell = (TopTableViewCell *)[[[NSBundle mainBundle] loadNibNamed:@"TopTableViewCell"
owner:self options:nil] objectAtIndex:0];
//cell.lbValue.hidden = YES;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
//config the cell
return cell;
}
else{
static NSString *identifyCell = @"HomeCell";
HomeTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifyCell];
if (!cell) {
cell = (HomeTableViewCell *)[[[NSBundle mainBundle] loadNibNamed:@"HomeTableViewCell"
owner:self options:nil] objectAtIndex:0];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
//cell.lbValue.hidden = YES;
cell.selectionStyle = UITableViewCellSelectionStyleGray;
}
cell.homeimg.image = [UIImage imageNamed:@"home1.jpg"];
//config the cell
return cell;
}
}
您需要发布更多信息,是否使用IB for tableview,向我们展示您的代码如何创建单元格,是否使用自动布局?这对您的帮助还不够。检查您的tableview坐标单元格的高度足够。使用xib的单元格。我没有使用自动布局tableview坐标,如果我删除0部分的单元格,下一个单元格将显示良好。