iphone - 如何限制 Landscape 中的 modalViewController?

标签 iphone ios ipad modalviewcontroller presentmodalviewcontroller

我正在开发 iPad 应用程序,在 modalView Controller 中显示一些 View 。 在景观中,当我单击 UITextField 进行一些输入时,模态视图 Controller 会上升并出现键盘。
但我改变了 modalViewController 的高度,我不希望 modalView 上升到键盘。我怎样才能做到这一点?有什么帮助吗?

最佳答案

在 UIViewController 的代码中,您移动其 modalViewController 的位置,检查界面方向是否不是横向

if(([self.interfaceOrientation!=UIInterfaceOrientationLandscapeLeft])
     &&([self.interfaceOrientation!=UIInterfaceOrientationLandscapeRight]))
//your code to repostion the view controlled by the modalViewController

关于iphone - 如何限制 Landscape 中的 modalViewController?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8381650/

相关文章:

iphone - 是否可以将音乐从 Android/iOS 设备流式传输到桌面设备?

iphone - 无法使用另一个类的 setHidden 属性隐藏控件?

ios - 如何使用 IQKeyboardManager 跳过隐藏的 UITextField?

iphone - 在文本字段中模仿 Twitter/G+ 标记功能

objective-c - iOS内存泄漏与字典

iphone - 如何获取 UIImagePickerController 选择的图像文件大小?

ios - "process launch failed: failed to get the task for process 2282"如何解决?

ios - 如何在 Xcode 6 中为 watchKit 创建一个空项目?

ios - 发送 iOS 推送通知时超时

iphone - 为什么我的 UIViewController 的指定初始化器从未被调用?