在适配iPhoneX
的时候,发现了一个bug,当程序正常启动运行时候,若push
一个控制器,tabBar
需要隐藏时候,是可以正常隐藏的。
但是以下情况不正常:
A界面 presentViewController到B界面 从B界面dismissViewControllerAnimated回A界面,此时从A界面,任意一控件push到C,这一过程中,tabBar会被压缩
1️⃣:当某个控制器需要被presentViewController:
之后,
2️⃣:再dismiss消失,
3️⃣:然后操作push
任何一个控制器,tabBar
会有点压缩。
如图所示,重点看tabBar
变化。
一、push
到一半的时候,一般情况下是如下图所显示,这是正常显示:

二、如果presentViewController:
向上弹出一个控制器,比如需要登录的登录页面,然后再dismiss
,之后push
一个页面到一半的时候会是如下图所示的结果:

三、解决办法:
假如需要被present
的控制器是presentVC
,需要设置:
//模态时候显得渐变柔和
// presentVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
// 解决以上的适配问题
presentVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
OK!over!
网友评论