交互式Pop Gesture的安全区域底部布局问题

问题描述 投票:1回答:2

enter image description here

我们使用了默认的tabbarcontroller。 Tabbar rootViewController显示tabbar和其他viewcontroller隐藏tabbar。当我们使用interactivePopGesture时,safearea的底部布局不会更新hight。所有其他情况下它的工作正常

    override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)

    if navigationController?.viewControllers[0] == self {
        tabBarController?.tabBar.isHidden = false

    } else {
        tabBarController?.tabBar.isHidden = true

    }
}
ios swift iphone ios11
2个回答
1
投票

//问题出现在与Tabbar相关的视图控制器属性中

enter image description here

按照以下步骤:

1)选择了tabbar profile viewcontroller

2)在Push上禁用Hide Bottom bar

3)当您按下其他视图控制器时,在Push上启用Hide Bottom bar


1
投票
// i was solved this issue like that in appdelegate when iam check user already login then i will remove removeGestureRecognizer from view
 let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
            let loginPageView = mainStoryboard.instantiateViewController(withIdentifier: "CustomTabVCID") as! CustomTabVC
            let rootViewController = self.window!.rootViewController as! UINavigationController
            rootViewController.view.removeGestureRecognizer(rootViewController.interactivePopGestureRecognizer!)
            rootViewController.pushViewController(loginPageView, animated: true)

// for bottom bar
    // Use this [![enter image description here][1]][1]
    // add this line when you navigate to a ViewController hidesBottomBarWhenPushed
    let vc = storyboard.instantiateViewController(withIdentifier: VC_IDENTIFIER) as! YourViewController
        vc.hidesBottomBarWhenPushed = true
     navigationController?.pushViewController(vc, animated: true)

    // hope its work for you

    or try with Main StoryBoard!
      [1]: https://i.stack.imgur.com/IiVrj.png
© www.soinside.com 2019 - 2024. All rights reserved.