0
我有一個UIWebView嵌入作爲子視圖,從Web加載一個HTML表單。問題是,當您選擇其中一個文本字段時,它會收到焦點,但鍵盤不顯示。這隻發生在iOS6上,如果我在iOS 4.3,5.1等上運行此應用程序,它按預期工作。任何一個有任何建議iOS的UIWebView不顯示鍵盤當文本字段獲得焦點
- (void)viewDidLoad
{
[super viewDidLoad];
webView = [[UIWebView alloc] init];
[webView setUserInteractionEnabled:YES];
[webView setScalesPageToFit:YES];
[webView setKeyboardDisplayRequiresUserAction:YES];
// load url here
NSURL *url = [NSURL URLWithString:redirectUrl];
//URL Requst Object
NSMutableURLRequest *requestObj = [NSMutableURLRequest requestWithURL:url];
[requestObj setHTTPMethod:@"POST"];
[webView loadRequest:requestObj];
UIScrollView* sv = nil;
for(UIView* v in [webView subviews]){
if([v isKindOfClass:[UIScrollView class] ]){
sv = (UIScrollView*) v;
sv.scrollEnabled = NO;
sv.bounces = NO;
}
}
[webView setOpaque:NO];
[webView setBackgroundColor:[UIColor whiteColor]];
webView.delegate = self;
[self.view addSubview:webView];
}