0

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

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

我不认为我的代码是正确的,但我试了一下,它没有用。所以请建议我如何检查所有单元格上的 imageView 是否隐藏?

4

1 回答 1

0

试试下面的代码希望它可以帮助你。

for (customTableViewCell* tblCell in tableView.visibleCells)
    {
        if (tblCell.unlockImageView.hidden)
        {
            NSLog(@"Imageview is hidden");
        }
    }
于 2014-11-19T11:03:08.873 回答