【问题标题】:ipad: keybord at wrong positionipad:键盘位置错误
【发布时间】:2012-07-21 10:19:02
【问题描述】:

当我切换到另一个视图时(从拍照返回或切换到视图以选择表格中的内容后)ipad 键盘出现在错误的位置。 当我选择一个文本字段时,我会在我的 Ipad 和模拟器上看到它。 (还不能发布图片)。如果我转动我的 ipad(使其水平对齐)并向后旋转,键盘就会恢复正常。

https://devforums.apple.com/servlet/JiveServlet/showImage/2-701040-19966/Screen+Shot+2012-07-20+at+16.36.20.png

我的代码切换到相机拍照...

- (IBAction)getCameraPicture:(id)sender
{
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.delegate = self;
    picker.allowsEditing = YES;
    picker.sourceType = UIImagePickerControllerSourceTypeCamera;
    picker.title = @"CameraPicture";
    [self presentModalViewController:picker animated:YES];
}

我的代码切换到其中有一个表的视图:

[self presentModalViewController:viewControllerSpanoTechProducts animated:YES];

选择后返回的代码:

[self dismissModalViewControllerAnimated:YES];

我的应用程序是如何工作的:您有一个带有按钮和文本字段的主屏幕来填写表格。当您按下按钮选择产品时,我会切换到另一个带有表格的视图控制器,您可以在其中选择产品和“完成”按钮。如果您单击“完成”按钮,我将切换回原始视图..希望这有帮助吗? 我刚开始使用 iOS .. 任何帮助都是 appriciated!

【问题讨论】:

  • 您的申请流程不清楚,能否提供更多详细信息...??
  • 我已经编辑了我的帖子。希望对您有所帮助...

标签: xcode ipad ios5 keyboard


【解决方案1】:

切换用户时这段代码:

[yourTextFieldObject resignFirstResponder];

这可能有效。

【讨论】:

  • 感谢回复,但它不起作用。认为它以一种操作顺序起作用,但我有多个文本字段和视图控制器.. 其他想法?
猜你喜欢
  • 2011-03-13
  • 2021-01-22
  • 1970-01-01
  • 1970-01-01
  • 2021-11-01
  • 1970-01-01
  • 2011-02-07
  • 2011-02-14
  • 1970-01-01
相关资源
最近更新 更多