美文网首页
升级iOS14导致的问题

升级iOS14导致的问题

作者: Jerome_e7ec | 来源:发表于2020-10-20 21:17 被阅读0次

    UITableiViewCell 的点击事件无效

    原因就是contenView变成了懒加载,如果cell内未使用contenview,则查看层级可以发现在cell内多了一个UITableViewCellContentView累的对象,遮挡了cell. addSubView方式添加的视图。
    解决方式:

    1. 隐藏contentView,contentView.isHidden = true
    2. 将view添加到contentView上

    iOS14 missing TabBar on popping multiple ViewControllers

    1. 设置pushViewController
    // fix: sometimes push and then popback no tabbar error
    - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
      if (self.viewControllers.count == 1) {
        viewController.hidesBottomBarWhenPushed = YES;
      } else {
        viewController.hidesBottomBarWhenPushed = NO;
      }
      [super pushViewController:viewController animated:animated];
    }
    
    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        if viewControllers.count == 1 {
            viewController.hidesBottomBarWhenPushed = true
        }else {
            viewController.hidesBottomBarWhenPushed = false
        }
        super.pushViewController(viewController, animated: animated)
    }
    
    1. 直接将弹出动画改为false
    [UINavigationController popToRootViewControllerAnimated:NO];
    
    navigationController?.popToRootViewController(animated: false)
    

    相关文章

      网友评论

          本文标题:升级iOS14导致的问题

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