菜鸟教程小白 发表于 2022-12-11 20:36:58

objective-c - iPad UIModalPresentationPageSheet 顶部 40 像素被截断


                                            <p><p>我使用的是 FormSheet 样式的模态视图,但为了显示更多信息,我正在切换到 PageSheet。当我将代码更改为此:</p>

<pre><code>targetController.modalPresentationStyle = UIModalPresentationPageSheet;
</code></pre>

<p>我明白了(注意顶部的红色条被切断了):</p>

<p> <img src="/image/r9L2p.png" alt="enter image description here"/> </p>

<p>有什么想法吗?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>根据<a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html" rel="noreferrer noopener nofollow">documentation</a> <code>UIModalPresentationPageSheet</code> 将为您提供<strong>屏幕</strong>的高度。</p>

<blockquote>
<p>The height of the presented view is set to the height of the screen and...</p>
</blockquote>

<p>这与用户界面的<em>可用</em>高度不同。您可以隐藏状态栏,例如:</p>

<pre><code>UIApplication.SharedApplication.StatusBarHidden = true;
</code></pre>

<p>并使屏幕的高度等于可用的 UI 高度<strong>或</strong>从框架中减去状态栏高度。</p></p>
                                   
                                                <p style="font-size: 20px;">关于objective-c - iPad UIModalPresentationPageSheet 顶部 40 像素被截断,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/8303867/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/8303867/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: objective-c - iPad UIModalPresentationPageSheet 顶部 40 像素被截断