首页 > 解决方案 > 收藏视图交互在 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;
    }
}

只是通知自定义collectionview单元类再次包含子collection view

标签: iosswiftuicollectionview

解决方案


尝试将您的视图组件添加到单元格的内容视图中,而不是直接作为子视图。


推荐阅读