I have a UIView
with a UITextField
placed at the bottom of the screen which will move up when a keyboard appears.
I have been following the bel
I'm not sure if this is your problem but you should use the block based APIs to animate a UIView
Example (not tested)
- (void)animateTextField:(UITextField*)textField
up:(BOOL)up
{
const float movementDuration = 0.5f;
const int movementDistance = 380;
int movement = (up ? -movementDistance : movementDistance);
[UIView animateWithDuration:movementDuration
animations:
^{
CGRect frame = self.bottomView.frame;
frame.origin.y = self.view.frame.size.height - 266.0f;
self.bottomView.frame = frame;
}
];
}
You can read in Apple's doc:
Use of this method is discouraged in iOS 4.0 and later. You should use the block-based animation methods to specify your animations instead.
https://developer.apple.com/Library/ios/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/AnimatingViews/AnimatingViews.html
Hope it helps you!