美文网首页
ios18 崩溃2024-11-15

ios18 崩溃2024-11-15

作者: iOS打怪升级 | 来源:发表于2024-11-14 16:37 被阅读0次
  • collection 滚动崩溃:

**** 崩溃代码:

   NSInteger lastY = 0;
        NSInteger section = MAX(self.firstArray.count-1, 0);
        NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:section];
        UICollectionReusableView *view = [self.collectionView.dataSource collectionView:self.collectionView viewForSupplementaryElementOfKind:UICollectionElementKindSectionHeader atIndexPath:indexPath];
        lastY = view.hq_y;
        
        UIEdgeInsets insets = self.collectionView.contentInset;
        insets.bottom = self.collectionView.hq_height - (self.collectionView.contentSize.height-lastY);
//        insets.left = 15;
        self.collectionView.contentInset = insets;

解决方法:collection 的回调方法之外不要试图去根据indexPath获取cell ,不过可以间接的去获取,比如下面的方法

        NSIndexPath *indexPath = [NSIndexPath indexPathForItem:0 inSection:section];
        UICollectionViewLayoutAttributes *attributes = [_collectionView layoutAttributesForItemAtIndexPath:indexPath];
        lastY = attributes.frame.origin.y;

相关文章

  • ios18~navigationController侧滑返回

    2018.07.02 UINavigationController实现侧滑返回 appDelgate中didFin...

  • 崩溃崩溃再崩溃

    总在一次次崩溃中好起来,再一次次的崩溃。。。。 真的很厌倦这种感觉。 安心对我来说太难了。不要害怕,你的情绪很多是...

  • 2021-04-22

    每天都要精神崩溃几次 最崩溃的就是我不能真的崩溃 崩溃!

  • 崩溃的礼物🎁

    允许自己的崩溃, 看见自己的崩溃, 体验自己的崩溃, 不抗拒自己的崩溃, 明白崩溃之后的寻求触底 不期待崩溃之后有...

  • 值传递?址传递,慎用形参,崩溃修复记录

    查询崩溃问题流程 拿到崩溃日志 查看崩溃线程、崩溃原因 查看崩溃函数堆栈 确定崩溃调用参数 根据控制台日志来具体分...

  • 崩溃

    崩溃到极致 崩溃到极致 崩溃到极致

  • 崩溃优化

    1、崩溃分类 Android崩溃分为两类,分别是Java崩溃和Native崩溃。Java崩溃就是产生在Java代码...

  • 安卓Java崩溃的捕获和日志记录

    Android的两种崩溃 Android 崩溃分为 Java 崩溃和 Native崩溃两种。 Java崩溃的知识点...

  • 崩溃优化(上)

    1. Android 的两种崩溃 Android 分为 Java 崩溃和 Native 崩溃。 java 崩溃:在...

  • iOS线上崩溃追踪

    目录一、崩溃收集介绍二、第三方库收集崩溃信息三、原生收集崩溃信息四、崩溃信息符号化五、崩溃中断拦截 一、崩溃收集介...

网友评论

      本文标题:ios18 崩溃2024-11-15

      本文链接:https://www.haomeiwen.com/subject/zuajjjtx.html