【发布时间】:2014-03-11 12:19:22
【问题描述】:
我正在开发一个由UICollectionViews 和UITableView 组成的iPhone 应用程序
使每个集合水平滚动。除了当我开始滚动每个UICollectionView UICollectionViewCell 方法被重用和
标签有问题,下图中的问题
我在滚动表格视图时遇到了每个集合标题的问题,我这样做了
NSString *CellIdentifier = [NSString stringWithFormat:@"CellId%d%d",indexPath.row,indexPath.section];
TableViewCell *cell = (TableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(!cell)
{
cell = [[TableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
我为每个单元格分配了唯一标识符,有什么建议可以提供帮助吗? :)
【问题讨论】:
-
交叉检查重用collectionView和TableView单元格的代码。可能是您没有正确重复使用单元格。
-
我不知道您的代码的确切问题,但这部分似乎是错误的。 NSString *CellIdentifier = [NSString stringWithFormat:@"CellId%d%d",indexPath.row,indexPath.section];
-
我更改了此代码,并在 uitableviewcell static NSString *CellIdentifier = @"CellIdentifier";同样的问题仍然存在
标签: ios iphone uitableview uicollectionview