【发布时间】:2015-12-17 11:28:17
【问题描述】:
我在这里遇到了一些问题。我有我的应用程序的主要视图,适用于不同的窗口。我已将它们从视线中移开,并且它们会在需要时进行动画处理,在我决定创建一个文本字段之前,我从来没有遇到过这个问题。当我单击按钮将视图带入显示时,它会出现,但是当我单击要键入的文本字段并且键盘加载时,视图会消失,但是如果我单击按钮以使视图返回,则将输入文本字段并准备好输入。有人有任何解决方案吗?我在下面附上了视图出现方式的代码。
谢谢,
柯蒂斯B
- (IBAction)login:(id)sender {
sidebutton = @"0";
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.0];
[self.blackhide setFrame:CGRectMake(self.blackhide.frame.origin.x -750, self.blackhide.frame.origin.y, self.blackhide.frame.size.width, self.blackhide.frame.size.height)];
[UIView setAnimationDuration:0.5];
[self.button2 setFrame:CGRectMake(self.button2.frame.origin.x - 300, self.button2.frame.origin.y, self.button2.frame.size.width, self.button2.frame.size.height)];
[self.mainview setFrame:CGRectMake(self.mainview.frame.origin.x - 300, self.mainview.frame.origin.y, self.mainview.frame.size.width, self.mainview.frame.size.height)];
[self.sidebarview setFrame:CGRectMake(self.sidebarview.frame.origin.x - 376, self.sidebarview.frame.origin.y, self.sidebarview.frame.size.width, self.sidebarview.frame.size.height)];
[UIView setAnimationDuration:0.0];
[self.loginview setFrame:CGRectMake(self.loginview.frame.origin.x + 376, self.loginview.frame.origin.y, self.loginview.frame.size.width, self.loginview.frame.size.height)];
}
【问题讨论】:
-
添加更多代码,即您对文本字段所做的操作
-
块。基于。动画片。自从。 iOS4。请。谢谢。你。
标签: ios objective-c uiviewanimation ios-keyboard-extension