旋转 iPhone 时出现黑色边框角

发布于 2024-08-30 10:20:02 字数 211 浏览 3 评论 0原文

我的应用程序是横向的,仅对根视图控制器的 shouldAutorotateToInterfaceOrientation 中的 UIInterfaceOrientationLandscapeRight 返回 true 称呼。

但是当我旋转设备时 纵向和背面,我有时会看到黑色角旋转,就好像显示屏周围的厚黑框正在旋转,并且在角上 50 像素左右可见。

知道这是什么或如何解决它吗?

My app is landscape and returns true only for UIInterfaceOrientationLandscapeRight in the root view controller's shouldAutorotateToInterfaceOrientation
call.

However when I rotate the device
to portrait and back, I sometime see black corners rotate through as if a thick black frame around the display is rotating and just visible on the corner 50 pixels or so.

Any idea what this is or how to fix it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南风起 2024-09-06 10:20:02

iPhone 上的动画本质上是通过在每次绘制到内部存储的位图中时缓存屏幕的外观来工作的。当屏幕旋转、翻转等时,动画中实际上使用的是这些缓存的图像,并且在动画完成之前屏幕本身不会重绘。

如果您在屏幕周围看到黑色边框,可能是因为您正在绘制边框。但是,您可能只是描述任何应用程序的正常旋转动画 - 旋转时,旋转图像/缓存视图后面会显示黑色背景,因为在旋转过程中,有些点旋转的正方形无法填充屏幕到角落。据我所知,这种黑色背景是苹果公司做出的设计决定,开发者没有办法改变颜色。

The animation on the iphone essentially works by caching the look of the screen each time it's drawn into internally stored bitmaps. When the screen rotates, flips etc. it is actually these cached images which are used in the animation, and the screen itself is not redrawn until the animation is finished.

If you're seeing a black border around your screen, it might be because you're drawing one. However, you may just be describing the normal rotation animation of any app - there is a black background displayed behind the rotated image/cached view as it rotates, because during the rotation there are points where the rotating square shape can't fill the screen to the corners. This black background, as far as I know, is a design decision made by Apple and there isn't a way for developers to change the color.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文