您的位置:首页 > 产品设计 > UI/UE

IPad使用UIModalPresentationFormSheet时隐藏键盘

2013-04-10 17:12 483 查看


IPad使用UIModalPresentationFormSheet时隐藏键盘

普通的做法resignFirstResponder在UIModalPresentationFormSheet的时候不起效
加上如下代码:

[passwordField resignFirstResponder];

@try

{

Class UIKeyboardImpl = NSClassFromString(@"UIKeyboardImpl");

id activeInstance = [UIKeyboardImpl performSelector:@selector(activeInstance)];

[activeInstance performSelector:@selector(dismissKeyboard)];

}

@catch (NSException *exception)

{

NSLog(@"%@", exception);

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: