WEB开发网
开发学院手机开发iPhone 开发 IPad使用UIModalPresentationFormSheet时隐藏键盘... 阅读

IPad使用UIModalPresentationFormSheet时隐藏键盘

 2012-06-29 20:53:26 来源:WEB开发网   
核心提示: 普通的做法resignFirstResponder在UIModalPresentationFormSheet的时候不起效 加上如下代码:[passwordField resignFirstResponder]; @try { Class UIKeyboardImpl = NSClassFromString(@&quo

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


[passwordField resignFirstResponder];
@try {
Class UIKeyboardImpl = NSClassFromString(@"UIKeyboardImpl");
id activeInstance = [UIKeyboardImpl performSelector:@selector(activeInstance)]; [activeInstance performSelector:@selector(dismissKeyboard)];
}
@catch (NSException *exception) {
NSLog(@"%@", exception);
}

Tags:IPad 使用 UIModalPresentationFormSheet

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接