照片选择器应用程序也有同样的问题!
这和我之前的帖子有关,但这里开了一个新帖子,因为它涉及苹果自己的示例代码。
打开示例代码并修改应用程序,使其以横向显示并向视图添加文本字段。
运行应用程序并打开图像选择器,选择一个图像,您将按照预期返回到上一个横向屏幕。
现在点击文本字段并看到键盘滚动到视图中......在纵向模式下?
这种情况发生在 iPad 上而不是 iPhone 上,这是怎么回事???
This is related to my previous thread, but opened a new one here as it involves Apple's own sample code.
Open the sample code and modify the app so it will display in landscape and add a textfield to the view.
Run the app and open the image picker, select an image and you will be returned to the previous screen in landscape as you would expect.
Now tap the text field and see the keyboard scroll into view....in portrait mode?
This happens on the iPad not the iPhone, what gives????
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在这个论坛上找到了答案:-)
“键盘将显示在状态栏的方向上,由于某种原因,状态栏并不总是随着旋转而改变。因此,如果您只想在横向设置中显示该视图[UIApplication SharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeLeft; 或您希望在 viewWillAppear 方法中选择的方向。”
但为什么它在 iPhone 上不这样做???
I have found the answer on this forum :-)
"The keyboard will show up in the orientation of the statusbar, which doesn't always change with rotations for some reason. So if you want to display that view only in landscape set [UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeLeft; or whichever orientation you want to prefer in your viewWillAppear method."
Although why it does not do this on the iPhone ????