0

In my program I use the following code to animate the self.view due to the soft keyboard covering up a UITextField at the bottom of the page.

- (IBAction)moveViewUp:(UITextField *)textField
{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.25];
    self.view.frame = CGRectMake(0,-150,320,400);
    [UIView commitAnimations];

}

And the following code brings the view back to original position.

- (IBAction)moveViewDown:(UITextField *)textField
{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.25];
    self.view.frame = CGRectMake(0,0,320,400);
    [UIView commitAnimations];

}

But once both methods are executed, the screen looks very normal though, a UIButton in the screen stops capturing any touches on it.

Any tips would be highly appreciated.

Maduranga E
  • 1,679
  • 5
  • 23
  • 37
  • 1
    When things like this happen to me, it's always because I have managed to move my button outside the view's frame and I'm not clipping to bounds, so I still see the button, but can't tap it. Try changing the background color of the view to make sure it's still really inside the frame. – DBD Jan 08 '13 at 15:50
  • What view is the button contained in? self.view? It seems like there must be something else happening, not contained in the code given, that is causing the problem. – patr1ck Jan 16 '13 at 19:02
  • did you solved this problem? I also have same question http://stackoverflow.com/questions/18993151/after-using-cgaffinetransform-action-on-viewable-uibutton-is-not-called – Fahim Parkar Sep 24 '13 at 22:46

0 Answers0