在我的一个应用程序中,我用集合视图实现了仪表板屏幕,当用户单击集合视图单元格时,它没有交互,这只发生在iPhone12 pro用户身上。
目前我没有那个实时设备可以测试,但是我已经在iPhone12 pro max模拟器中测试过了,而且它的工作效率很高。
你能提出什么原因或建议吗?提前感谢
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0)
{
customClassCollectionViewCellOne *cell = [[customClassCollectionViewCellOne alloc]initWithFrame:CGRectMake(0, 0, 0, 0)];
cell = (customClassCollectionViewCellOne *)[collectionView dequeueReusableCellWithReuseIdentifier:@"accountBalance_main_collectionview" forIndexPath:indexPath];
cell.balanceArray = newbalanceArray;
cell.delegate = self;
[cell.collectionView reloadData];
return cell;
}
else if (indexPath.section == 1)
{
customClassCollectionViewCellTwo *cell = [[customClassCollectionViewCellTwo alloc]initWithFrame:CGRectMake(0, 0, 0, 0)];
cell = (customClassCollectionViewCellTwo *)[collectionView dequeueReusableCellWithReuseIdentifier:@"QuickActions_main_collectionview" forIndexPath:indexPath];
cell.quickActionList = viewModel.quickActionsList;
cell.delegate = self;
[cell.collectionView reloadData];
return cell;
}
else
{
customClassCollectionViewCellThree *cell = [[customClassCollectionViewCellThree alloc]initWithFrame:CGRectMake(0, 0, 0, 0)];
cell = (customClassCollectionViewCellThree *)[collectionView dequeueReusableCellWithReuseIdentifier:@"GetInTouch_main_collectionview" forIndexPath:indexPath];
cell.getinTouchList = viewModel.touchList;
cell.delegate = self;
[cell.collectionView reloadData];
return cell;
}
}只是再次通知自定义集合单元格类包含子集合视图。
发布于 2021-06-25 12:53:40
尝试将视图组件添加到单元格的内容视图中,而不是直接作为子视图。
https://stackoverflow.com/questions/68082978
复制相似问题