cell imageView in UITableView doesn't appear until selected

前端 未结 8 1938
慢半拍i
慢半拍i 2020-12-24 01:44
  1. Here is a video of the problem: http://youtu.be/Jid0PO2HgcU

  2. I have a problem when trying to set the image for the [cell imageView] in a UITableView

8条回答
  •  生来不讨喜
    2020-12-24 02:27

    I get same issue when i use this code:

    cell = [tableView dequeueReusableCellWithIdentifier:kCellSection1 forIndexPath:indexPath];
            if (indexPath.row == 0) {
                cell = [[UITableViewCell alloc]  initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kCellSection1];
                cell.textLabel.text = @"Vote Up for me if it help for you!";
            }
    

    But I fix it by replace:

    cell = [[UITableViewCell alloc]  initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kCellSection1];
    

    To:

    cell = [cell initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kCellSection1];
    

提交回复
热议问题