- (void) animateTextView: (UITextView*) textView up: (BOOL) up
{
const int movementDistance = 120; // 需要多少位移
const float movementDuration = 0.3f; // 实现时间
int movement = (up ? -movementDistance : movementDistance);
[UIView beginAnimations: @"anim" context: nil];
[UIView setAnimationBeginsFromCurrentState: YES];
[UIView setAnimationDuration: movementDuration];
self.view.frame = CGRectOffset(self.view.frame, 0, movement);
[UIView commitAnimations];
}
实现self.view的整体上移
最新推荐文章于 2024-08-23 12:41:53 发布