Changing the iOS keyboard animation time

℡╲_俬逩灬. 提交于 2019-11-30 03:51:43

问题


Is there a way to change the time the iOS keyboard animation takes?


回答1:


I've actually found a better solution. What you can do is programmatically make the textfield or textview a first responder within an animation with duration of your choice. Example for making the keyboard emerge over the course of one second might be:

[UIView animateWithDuration:1.0 animations:^
{
     [myTextField becomeFirstResponder];
}];

Similarly, you can make the keyboard disappear like this:

[UIView animateWithDuration:1.0 animations:^
    {
         [myTextField resignFirstResponder];
    }];


来源:https://stackoverflow.com/questions/7542495/changing-the-ios-keyboard-animation-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!