iPad:加载时更改方向视图

发布于 2025-01-06 09:55:31 字数 356 浏览 2 评论 0原文

我在 iPad 上使用应用程序时遇到问题:
在我的应用程序中,我有一些横向和纵向视图,以及一些仅横向视图。对于这些视图,我这样做:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
    return UIDeviceOrientationIsLandscape(interfaceOrientation);
}

我使用 UIViewController 进行导航,当我处于纵向状态并且切换到仅处于横向状态的视图时,我会看到纵向视图的横向视图...
有办法解决这个问题吗?

I have a problem with my app on iPad :
In my app, I have some views in landscape and portrait and some views only in landscape. For these views I do:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
    return UIDeviceOrientationIsLandscape(interfaceOrientation);
}

I use a UIViewController to navigate and when I am in portrait and I switch to a view who was only in landscape, I see the landscape view in portrait...
Any idea to solve this?

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

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

发布评论

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

评论(1

述情 2025-01-13 09:55:31

发生这种情况是因为包含横向视图的基本视图支持纵向,您必须限制它。

This happens because the base view which contains the landscaped view supports portrait, you have to restirct it.

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