- (void)textFieldDidBeginEditing:(UITextField *)textField
{
[UIView beginAnimations:@"showKeyboardAnimation" context:nil];
[UIView setAnimationDuration:0.30];
self.view.frame = CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y- 80, self.view.frame.size.width, self.view.frame.size.height);
[UIView commitAnimations];
}
键盘挡住UITextField 时上推View
最新推荐文章于 2021-01-17 13:32:20 发布
本文详细介绍了如何在Swift中自定义键盘弹出动画,并通过调整视图的位置来模拟键盘遮挡效果。
2577

被折叠的 条评论
为什么被折叠?



