views:

20

answers:

1

Hello folks!

I have a button which when pressed, should push the controls below it down and show textFields on the space freed. Basically, just changing the position of these controls in an animated way. Any ideas/tips on how to do that?

I tried the code in: How to Make a UITextField Move Up When Keyboard Is Present

But couldn't get it to work just changing the methods. Appreciate any useful information.

Thanks!

A: 

I think you have write code for that. If your controls below is a view (BottomView), when you press the button, change the frame of the BottomView, to make room for the textfield view. Now add the textField there. Write the code in a Animation block.

   [UIView beginAnimations:nil context:NULL];
   [UIView setAnimationBeginsFromCurrentState:YES];
   [UIView setAnimationDuration:0.3f];
// bottomView.frame = (new frame)
// design a textfield in IB. make outlet. 
// textField.frame = (new frame)        
   [UIView commitAnimations];
karim
It worked! Thank you!
BeOliveira