显示键盘时,presentModalView 全屏视图向左移动
我有一个作为模式视图控制器呈现的登录页面,当 UITextField 成为纵向模式下的第一个响应者时,视图会向左移动。我想知道这是为什么呢?
代码非常简单:
LoginViewController* lvc = [[LoginViewController alloc] init];
lvc.delegate = self;
[self.parentViewController presentModalViewController:lvc animated:YES];
[lvc release];
这是在一个名为 OptionsViewController 的 UIViewController 内,它也以 modalViewController 的形式呈现。所以基本上我是从 modalViewController 呈现 modalViewController
I have a login page presented as a modal view controller and when the UITextField become the first responder under portrait mode the view shifts to the left. I wonder why is this?
The code is very simple:
LoginViewController* lvc = [[LoginViewController alloc] init];
lvc.delegate = self;
[self.parentViewController presentModalViewController:lvc animated:YES];
[lvc release];
This is inside a UIViewController called OptionsViewController which is presented as a modalViewController as well. So basically I am presenting a modalViewController from a modalViewController
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您在第二张图片上清楚地看到,当键盘出现时有一个 tableView,并且登录视图控制器(该视图)似乎由于表的问题而导致问题。
您已经从代码中的某个位置初始化了 tableView (或者)我的猜测是您已经创建了登录视图控制器以及另一个 TableView 控制器 .xib 接口...所以请检查您的代码。
如果您的代码中没有 tableView 初始化...那么请尝试执行以下步骤。
If you see clearly on the second image, there is a tableView when the keyboard comes up and the login view controller (that view) seems to causing problems because of the issues with the table.
Either you have initialized a tableView from somewhere in the code (or) my guess is that you have created the login view controller along with another TableView controller .xib interface... So please check your code.
If there is no tableView initialization on your code ... then try following these steps.