UIWebView
koboHTML
やiBooks
. _
推奨さWKWebView
れていないように見えるため、現在移行中です。UIWebView
WKWebView
ロングタッチジェスチャがまったく認識されず、選択が表示されないという問題に直面しています。この問題は、UIWebView
.
これが私が実装している方法ですWKWebView
:
WKWebViewConfiguration *theConfiguration = [[WKWebViewConfiguration alloc] init];
theConfiguration.selectionGranularity = WKSelectionGranularityCharacter;
readWKWebView = [[WKWebView alloc] initWithFrame:self.view.frame configuration:theConfiguration];
readWKWebView.contentMode = UIViewContentModeScaleAspectFit;
readWKWebView.scrollView.scrollEnabled = true;
readWKWebView.multipleTouchEnabled = true;
[self.view addSubview:readWKWebView];
readWKWebView.userInteractionEnabled = true;
readWKWebView.contentMode = UIViewContentModeScaleAspectFit;
[readWKWebView loadFileURL:htmlPathURL allowingReadAccessToURL:[NSURL fileURLWithPath:stringOfAllwedPath]];
[readWKWebView loadHTMLString:loadString baseURL:baseURL];
に次の css を挿入しますHTML
。
html {
height:730px;
font-size:24px;
width:100%;
}
body {
margin:0px;
padding:0px;
width:100%;
}
#viewer {
width:668px;
height:730px;
}
#book {
width:668px;
height:730px;
margin-left:50px;
margin-right:50px;
-webkit-column-count:auto;
-webkit-column-width:668px;
-webkit-column-gap:100px;
text-align:right;
}
.h {
margin-top:220px;
}
選択機能がない理由は何ですか?