나는이 동일한 문제로 분투하고 있습니다. 나는 아직하지만 지금까지 사용을 할 수있는 탭 지연 해제로 탭 오프셋 문제가 해결되지 않은 : 당신이 아직이 페이지를 발견 한 경우
[[self.webView scrollView] setDelaysContentTouches:NO];
확실하지,하지만 당신은 키보드 알림 리스너를 추가 할 수 있으며 자신을 스크롤 조작. 여기 https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html
보기 조작에 관한 링크에서 코드입니다 :있는 UIWebView 항상 키보드와 함께 이동하지 않는 내
// Call this method somewhere in your view controller setup code.
- (void)registerForKeyboardNotifications
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWasShown:)
name:UIKeyboardDidShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillBeHidden:)
name:UIKeyboardWillHideNotification object:nil];
}
// Called when the UIKeyboardDidShowNotification is sent.
- (void)keyboardWasShown:(NSNotification*)aNotification
{
NSDictionary* info = [aNotification userInfo];
CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0, 0.0, kbSize.height, 0.0);
scrollView.contentInset = contentInsets;
scrollView.scrollIndicatorInsets = contentInsets;
// If active text field is hidden by keyboard, scroll it so it's visible
// Your app might not need or want this behavior.
CGRect aRect = self.view.frame;
aRect.size.height -= kbSize.height;
if (!CGRectContainsPoint(aRect, activeField.frame.origin)) {
[self.scrollView scrollRectToVisible:activeField.frame animated:YES];
}
}
// Called when the UIKeyboardWillHideNotification is sent
- (void)keyboardWillBeHidden:(NSNotification*)aNotification
{
UIEdgeInsets contentInsets = UIEdgeInsetsZero;
scrollView.contentInset = contentInsets;
scrollView.scrollIndicatorInsets = contentInsets;
}
그것은 일부 히트 영역처럼 보인다는 여기에 애플의 문서 링크입니다. 한 가지 더러운 해킹은 보이지 않는 텍스트 div를 버튼 위에 놓고/etc에 공백을 두어 터치 이벤트가 등록되지 않은 것을 성취하려고하는 자바 스크립트 함수를 호출하는 것입니다. 좋아요 :
<div id="someBtn" onclick="tryAction();"> </div>
이 정보가 도움이되었거나 유용한 방향으로 나올 수 있기를 바랍니다.
어디에서 변수 activeField를 얻고 있습니까? – HaloZero