首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >集合视图交互不适用于iPhone12 pro。

集合视图交互不适用于iPhone12 pro。
EN

Stack Overflow用户
提问于 2021-06-22 11:45:59
回答 1查看 253关注 0票数 1

在我的一个应用程序中,我用集合视图实现了仪表板屏幕,当用户单击集合视图单元格时,它没有交互,这只发生在iPhone12 pro用户身上。

目前我没有那个实时设备可以测试,但是我已经在iPhone12 pro max模拟器中测试过了,而且它的工作效率很高。

你能提出什么原因或建议吗?提前感谢

代码语言:javascript
复制
- (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;
    }
}

只是再次通知自定义集合单元格类包含子集合视图。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-06-25 12:53:40

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68082978

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档