resignFirstResponder
我想知道在 TextView 上使用时,有什么方法可以减缓 iOS 应用程序中本机键盘的消失。键盘下降得太快了,我希望它走得更慢。那可能吗?
编辑: 我的上下文是这样的:我在当前视图之上添加了一个新视图,因此,我的键盘暂时消失了。这就是我的代码的样子:
- (void)viewDidLoad
{
[super viewDidLoad];
UIButton *tmpButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[tmpButton setTitle:@"Tap me" forState:UIControlStateNormal];
[tmpButton sizeToFit];
[tmpButton addTarget:self action:@selector(btnTestClicked) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:tmpButton];
}
- (void) btnTestClicked{
[tmpText resignFirstResponder];
}
我也有这样的视图层次结构:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
self.window.windowLevel = UIWindowLevelStatusBar + 1;
return YES;
}
该应用程序非常简单,但键盘消失得非常快,不像我没有任何其他视图时那样。