iOS overFullScreen与fullScreen区别分析
<div id="navCategory"><h5 class="catalogue">目录</h5><ul class="first_class_ul"><li>overFullScreen与fullScreen区别</li><ul class="second_class_ul"><li>overFullScreen</li><li>fullScreen</li></ul><li>总结</li><ul class="second_class_ul"></ul></ul></div><p class="maodian"></p><h2>overFullScreen与fullScreen区别</h2><p class="maodian"></p><h3>overFullScreen</h3>
<blockquote><p>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.</p></blockquote>
<p>当显示结束时,显示内容下面的视图不会从视图层次结构中删除。因此,如果呈现的视图控制器没有用不透明的内容填充屏幕,底层内容就会显示出来。</p>
<p class="maodian"></p><h3>fullScreen</h3>
<blockquote><p>The views belonging to the presenting view controller are removed after the presentation completes.</p></blockquote>
<p>属于呈现视图控制器的视图在呈现完成后被移除。</p>
<p>详见<code>Xcode->Window->Developer Documentation</code>。</p>
<p class="maodian"></p><h2>总结</h2>
<p>如果需要弹出半透明视图使用<code>overFullScreen</code>,但是由于<code>当显示结束时,显示内容下面的视图不会从视图层次结构中删除</code>,所以页面消失时下面的视图不会出发<code>viewWillAppear</code>等方法。</p>
<p>使用fullScreen,在页面消失会触发下面的视图的<code>viewWillAppear</code>等方法,但是<code>呈现视图控制器的视图在呈现完成后被移除</code>实现半透明时透明部分直接黑屏展示。</p>
<p>🐟与熊掌不可兼得😂😂😂。</p>
<p>以上就是iOS overFullScreen与fullScreen区别分析的详细内容,更多关于iOS overFullScreen fullScreen的资料请关注琼殿技术社区其它相关文章!</p>
<div class="art_xg">
<b>您可能感兴趣的文章:</b><ul><li>iOS关键字static extern const使用示例详解</li><li>iOS报Multiple commands produceMultiple错误的解决方案</li><li>iOS开发输入自动填充UITextField背景色</li><li>iOS小数取整的方法(ceil floor round)示例</li></ul>
</div>
</div>
<!--endmain--> 感谢楼主的详细分析!
之前开发的时候确实被这两种模式坑过,的区别讲得很清楚。
个人补充一点实际经验:
使用overFullScreen时要注意,如果你的弹窗页面有输入框,弹出键盘后可能会出现一些奇怪的布局问题,因为底层的视图还在层级里。
而fullScreen虽然会触发viewWillAppear,但黑屏这个问题确实很头疼。之前做半透明引导页的时候,不得不用自定义的presentation方式来实现。
鱼与熊掌不可兼得这句话太真实了😂
不过现在iOS15之后好像有些新的API可以更好的处理这种情况,楼主有研究过吗?
琼殿技术社区确实很多iOS相关的干货,收藏了!
頁:
[1]