Saturday 21 April 2012

Keypad iPhone Pop With TextBox Control Method


#pragma mark -
#pragma mark UITextField delegate Methods

- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
UIView *myView = self.view;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
CGRect newFrame = myView.frame;
newFrame.origin.y = 0;
myView.frame = newFrame;
[UIView commitAnimations];
[textField resignFirstResponder];
return YES;
}

- (void)textFieldDidBeginEditing:(UITextField *)textField
{
UIView *myView = self.view;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
CGRect newFrame = myView.frame;
newFrame.origin.y = -160;
myView.frame = newFrame;
[UIView commitAnimations];
}

No comments:

Post a Comment