CoderMJLee / MJRefresh

An easy way to use pull-to-refresh.
MIT License
13.8k stars 3.55k forks source link

iphone14 pro灵动岛,MJRefresh闪退 #1575

Open shandawy opened 2 years ago

shandawy commented 2 years ago

描述bug

我使用了JXSegmentedView框架 override func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {

    switch index {
    case 0:
        return NQPersonalQuestionListVC(actType: NQMyActType.Favorite.rawValue)
    case 1:
        return NQPersonalAnswerListVC(actType: NQMyActType.Favorite.rawValue)
    case 2:
        return NQPersonalEventListVC(vcType: .Forum, actType: NQMyActType.Favorite.rawValue)
    case 3:
        return NQPersonalEventListVC(vcType: .Webinar, actType: NQMyActType.Favorite.rawValue)
    default:
        return NQPersonalQuestionListVC(actType: NQMyActType.Favorite.rawValue)
    }
}

在NQPersonalQuestionListVC控制器里面,设置 tableView.contentInset = UIEdgeInsets(top: Configs.BaseDimensions.headerInSectionHeight, left: 0, bottom: 0, right: 0) 在iphone14 pro灵动岛,MJRefresh下拉刷新闪退,必现

但是如果设置 tableView.contentInsetAdjustmentBehavior = .never tableView.contentInset = UIEdgeInsets(top: Configs.BaseDimensions.navigationBarAreaHeight + Configs.BaseDimensions.headerInSectionHeight, left: 0, bottom: safeAreaBottom, right: 0) 不会出现闪退

运行环境

wolfcon commented 2 years ago

方便传一个Demo上来吗?

iAmNotTom commented 2 years ago

方便传一个Demo上来吗? 我也遇到类似的问题 并且定位到了原因 https://github.com/CoderMJLee/MJRefresh/pull/1576

iAmNotTom commented 2 years ago

描述bug

我使用了JXSegmentedView框架 override func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {

    switch index {
    case 0:
        return NQPersonalQuestionListVC(actType: NQMyActType.Favorite.rawValue)
    case 1:
        return NQPersonalAnswerListVC(actType: NQMyActType.Favorite.rawValue)
    case 2:
        return NQPersonalEventListVC(vcType: .Forum, actType: NQMyActType.Favorite.rawValue)
    case 3:
        return NQPersonalEventListVC(vcType: .Webinar, actType: NQMyActType.Favorite.rawValue)
    default:
        return NQPersonalQuestionListVC(actType: NQMyActType.Favorite.rawValue)
    }
}

在NQPersonalQuestionListVC控制器里面,设置 tableView.contentInset = UIEdgeInsets(top: Configs.BaseDimensions.headerInSectionHeight, left: 0, bottom: 0, right: 0) 在iphone14 pro灵动岛,MJRefresh下拉刷新闪退,必现

但是如果设置 tableView.contentInsetAdjustmentBehavior = .never tableView.contentInset = UIEdgeInsets(top: Configs.BaseDimensions.navigationBarAreaHeight + Configs.BaseDimensions.headerInSectionHeight, left: 0, bottom: safeAreaBottom, right: 0) 不会出现闪退

运行环境

  • iphone14 pro
  • iOS16
  • Xcode14 1664175979795 1664176027746

我也遇到类似的问题 并且定位到了原因 https://github.com/CoderMJLee/MJRefresh/pull/1576

iAmNotTom commented 2 years ago

方便传一个Demo上来吗?

Demo如下(使用非SceneDelegate方式启动App view.safeAreaInsets.top就会返回精度极高的值) TestRefreshDemo.zip in Xcode 14 @wolfcon