Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这和我之前的帖子有关,但在这里开了一个新的,因为它涉及到苹果自己的示例代码。
打开示例代码并修改应用程序,使其横向显示并向视图添加一个文本字段。
运行应用程序并打开图像选择器,选择一张图像,您将返回到您所期望的横向屏幕。
现在点击文本字段并看到键盘滚动到视图中......在纵向模式下?
这发生在 iPad 上而不是 iPhone 上,这是什么原因????
链接文本
我在这个论坛上找到了答案:-)
“键盘将显示在状态栏的方向上,由于某种原因,它并不总是随着旋转而改变。因此,如果您只想在横向设置中显示该视图 [UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeLeft; 或您选择的任何方向希望在您的 viewWillAppear 方法中更喜欢。”
虽然为什么它不在 iPhone 上这样做????