集合视图交互不适用于 iPhone12 pro max
Collection view interaction is not working on iPhone12 pro max
在我的一个应用程序中,我实现了带有集合视图的仪表板屏幕,当用户点击集合视图单元格时,它没有交互,这只发生在 iPhone12 pro max 用户
目前我没有那个实时设备来测试,但我已经在 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;
}
}
只是通知
自定义集合视图单元格 class 再次包含子集合视图
尝试将您的视图组件添加到单元格的内容视图中,而不是直接作为子视图。
在我的一个应用程序中,我实现了带有集合视图的仪表板屏幕,当用户点击集合视图单元格时,它没有交互,这只发生在 iPhone12 pro max 用户
目前我没有那个实时设备来测试,但我已经在 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;
}
}
只是通知 自定义集合视图单元格 class 再次包含子集合视图
尝试将您的视图组件添加到单元格的内容视图中,而不是直接作为子视图。