<分区>
在 objective-c 中,当您在 UITextField
上设置 becomeFirstResponder
时,键盘会从底部向上滑动。
有什么方法可以禁用这个动画吗?
<分区>
在 objective-c 中,当您在 UITextField
上设置 becomeFirstResponder
时,键盘会从底部向上滑动。
有什么方法可以禁用这个动画吗?
最佳答案
在动画过程中这样做,像这样
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.0];
[UIView setAnimationDelay:0.0];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[textField becomeFirstResponder];
[UIView commitAnimations];
如果以上出于任何原因不起作用,那么您可以使用通知
关于iphone - 显示没有动画的 UIKeyboard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15005556/
相关文章:
iphone - 通过使用 2 个按钮操作调用相同 View 导致 segue 出错
ios - iPhone X 上未收到 Firebase 通知 FCM
ios - "Could not find a storyboard named ' 主 Storyboard ' in bundle NSBundle"
iphone - 如何使用 NSPredicate 检索 NSArray 的索引?
iphone - 如何创建一行 UILabels 的 "container" View ?
javascript - Undefined 不是一个对象(评估 'navigator.permissions.query' )
objective-c - GPUImage capturePhotoAsImageProcessedUpToFilter 仅适用于最后一个过滤器