iOS overFullScreen与fullScreen区别

overFullScreen与fullScreen区别

overFullScreen
The views beneath the presented content are not removed from the view hierarchy when the presentation finishes.  So if the presented view controller does not fill the screen with opaque content, the underlying content shows through.
当显示结束时,显示内容下面的视图不会从视图层次结构中删除。因此,如果呈现的视图控制器没有用不透明的内容填充屏幕,底层内容就会显示出来。
fullScreen
The views belonging to the presenting view controller are removed after the presentation completes.
属于呈现视图控制器的视图在呈现完成后被移除。

详见Xcode->Window->Developer Documentation

总结

如果需要弹出半透明视图使用overFullScreen,但是由于当显示结束时,显示内容下面的视图不会从视图层次结构中删除,所以页面消失时下面的视图不会出发viewWillAppear等方法。
使用fullScreen,在页面消失会触发下面的视图的viewWillAppear等方法,但是呈现视图控制器的视图在呈现完成后被移除实现半透明时透明部分直接黑屏展示。
🐟与熊掌不可兼得😂😂😂。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容