Navigation controller top layout guide not honored with custom transition

前端 未结 12 1535
暖寄归人
暖寄归人 2020-12-04 11:35

Short version:

I am having a problem with auto layout top layout guide when used in conjunction with custom transition and UINavigationController in iO

12条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-04 11:50

    In storyboard add another vertical constraint to main view's top. I have the same problem too but adding that constraint help me to avoid manual constraints. See screenshot here link

    Other solution is to calculate toVC frame... something like this:

    float y = toVC.navigationController.navigationBar.frame.origin.y + toVC.navigationController.navigationBar.frame.size.height;
    toVC.view.frame = CGRectMake(0, y, toVC.view.frame.size.width, toVC.view.frame.size.height - y);
    

    Let me know if you have found a better solution. I have been struggling with this issue as well and I came up with previous ideas.

提交回复
热议问题