升级iOS14导致的问题

2020-10-20  本文已影响0人  Jerome_e7ec

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)
上一篇下一篇

猜你喜欢

热点阅读