对表视图单元格应用检查以隐藏图像视图



在我的tableView,我有5个tableView cells。每个都有一个imageView。 在tableView之外,有一个UIButtonUIButton上面也有图像。 现在,我的问题是检查cells上的图像是否被隐藏。 清除问题,我需要检查所有单元格,如果 所有cells上的imageView是否隐藏。我试过这段代码:

 for (int i=0; i<=4; i++) 
    {
     if (cell.unlockImageView.hidden)
     {
        NSLog(@"calling if for hiding image");
      }
    }

我认为我的代码不正确,但我试了一下,但没有 工作。所以请建议我如何检查该图像在所有单元格上查看 是不是隐藏的?

尝试下面的代码,希望它能帮助你。

for (customTableViewCell* tblCell in tableView.visibleCells)
    {
        if (tblCell.unlockImageView.hidden)
        {
            NSLog(@"Imageview is hidden");
        }
    }

最新更新