【发布时间】:2016-06-25 05:13:52
【问题描述】:
我有 13 个文本字段。我想为仅显示在底部的 4 个文本字段设置视图动画
这是我的代码:
if (textField.editing != ((_GET_companyname)||(_GET_firstname)||(_GET_middlename)||(_GET_lastname)||(_GET_companyurl)||(_GET_streetaddress)||(_GET_postbox)||(_GET_code)||(_GET_phonenum)))
{
NSLog(@"Entered in condition");
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
//Keyboard becomes visible
[UIView beginAnimations:nil context:NULL];
// [UIView setAnimationDuration:0.25];
self.view.frame = CGRectMake(0,-200,self.view.frame.size.width,self.view.frame.size.height);
[UIView commitAnimations];
}
}
else
{
NSLog(@"Entered else Part");
}
我需要将以下设置为所有 14 个文本字段
-(BOOL) textFieldShouldReturn:(UITextField *)textField{
[textField resignFirstResponder];
return YES;
}
【问题讨论】:
-
什么是_GET_companyname 和其他?
-
那么问题出在哪里?
-
我有 13 个文本字段我想将文本视图设置为全部并将 Uiview 动画设置为 4 个文本字段@Andy
-
GET 等是视图控制器@Kiran 中的文本字段
-
那你为什么要检查(textField.editing)?相反,您应该只检查(文本字段)
标签: ios objective-c cocoa-touch uitextfield