gpt4 book ai didi

iphone - 启用 iPhone 界面方向

转载 作者:可可西里 更新时间:2023-11-01 06:12:45 25 4
gpt4 key购买 nike

我试图让我的应用程序在设备本身旋转时旋转界面,但我做不到。我在 plist 信息文件中添加了支持的接口(interface),并为 shouldRotateToInterfaceOrientation 返回了 yes。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {      if (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) {          return YES;      } else {          return NO;      }  } 

旋转是这样实现的吗?
请帮忙!

最佳答案

也许尝试编辑 info.plist 并在那里添加您支持的方向?

选择您的项目 --> 选择您的目标 --> 信息 --> 支持的界面方向并点击加号 4 次以支持这些方向:

Item 0   Landscape (left home button)
Item 1 Landscape (right home button)
Item 2 Portrait (top home button)
Item 3 Portrait (bottom home button)

希望对您有所帮助!

关于iphone - 启用 iPhone 界面方向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4599578/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com