奇怪的 iPad 旋转效果

发布于 2024-11-30 17:29:43 字数 455 浏览 3 评论 0原文

我有一个非常标准的 iPad 应用程序,它设置为仅横向显示。为了实现这一点,我将初始界面方向设置为横向,并将支持界面方向设置为单个横向左主页按钮,并将 shouldAutorotateToInterfaceOrientation 属性重写为以下内容:

 -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
    BOOL b = UIInterfaceOrientationIsLandscape(interfaceOrientation);
    return b;
}

真正奇怪的是,当应用程序启动时,它是正确的,并且将 iPad 倒置旋转没有任何作用,但是按下主页按钮旋转会旋转屏幕,但一旦旋转,它就永远不会旋转回来,所以认为这不是旋转设置。

以前有人遇到过这个吗?

I have a pretty standard iPad application that is setup to only be landscape. To affect this, I have set the initial interface orientation to landscape, and the support interface orientations to just the single landscape left home button, and also overridden shouldAutorotateToInterfaceOrientation properties to the following:

 -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
    BOOL b = UIInterfaceOrientationIsLandscape(interfaceOrientation);
    return b;
}

The really odd thing is that when the app starts out, it is correct, and rotating the iPad upside down does nothing, but rotating with the home button down rotates the screen, but once rotated, it will never rotate back, so thinking this is something other than rotation settings.

Has anyone run into this before?

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

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

发布评论

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

评论(1

美煞众生 2024-12-07 17:29:43

来自文档:

#define UIInterfaceOrientationIsLandscape(orientation) \
   ((orientation) == UIInterfaceOrientationLandscapeLeft || \
   (orientation) == UIInterfaceOrientationLandscapeRight)

因此,如果您只想支持一种景观旋转,这不是可行的方法......

From the docs:

#define UIInterfaceOrientationIsLandscape(orientation) \
   ((orientation) == UIInterfaceOrientationLandscapeLeft || \
   (orientation) == UIInterfaceOrientationLandscapeRight)

So if you want to support just ONE of the landscape rotations, this is not the way to go...

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