1
ios에서 epub reader를 만들고 있습니다. 나는 uiwebview에 epub를 보여줄 수 있지만, epub doest의 크기는 uiwebview에 맞지 않습니다. epub 파일이 webview에서 더 크고 비례하지 않는 것으로 보입니다. 크기를 조정하려면 어떻게해야합니까? 감사..epub에서 pagebreak가 uiwebview에서 작동하지 않습니다. iOS
이것은 내 코드입니다.
vCover = [UIView의 ALLOC] initWithFrame : CGRectMake (0, 0, self.view.bounds.size.width, self.view.bounds.size.height)];
CGRect frame = busyLoad.frame;
frame.origin.x = self.view.frame.size.width/2 - frame.size.width/2;
frame.origin.y = self.view.frame.size.height/2 - frame.size.height/2;
busyLoad.frame = frame;
[self.view addSubview:vCover];
[self.view bringSubviewToFront:vCover];
[self.view addSubview:busyLoad];
[self.view bringSubviewToFront:busyLoad];
[busyLoad startAnimating];
int offset = [[NSString stringWithFormat:@"%@", todo.htmOffset]intValue]*webView.bounds.size.height;
NSLog(@"pageH:%f ", webView.bounds.size.height);
UIScrollView *scrollview = (UIScrollView *)[webView.subviews objectAtIndex:0];
scrollview.contentInset = UIEdgeInsetsMake(44.0,0.0,44.0,0.0);
NSString* javascript = [NSString stringWithFormat:@"window.scrollBy(0, %d);", offset];
[webView stringByEvaluatingJavaScriptFromString:javascript];
NSString *padding = @"document.body.style.margin='50';";
[webView stringByEvaluatingJavaScriptFromString:padding];
NSString *setTextSizeRule = [NSString stringWithFormat:@"addCSSRule('body', '-webkit-text-size-adjust: %d%%;')", 100];
[webView stringByEvaluatingJavaScriptFromString:setTextSizeRule];
NSLog(@"DidLoad:%d", offset);
[webView setHidden:NO];
[busyLoad removeFromSuperview];
[vCover removeFromSuperview];
[busyLoad stopAnimating];
당신은 당신이 안녕 응답에 감사드립니다있는 UIWebView – Retro
로 파일을 설정하는 방법을 공유 할 수 있습니다! 나는 uiwebview에서 페이지 나누기가 항상 작동하지 않는다는 것을 알게되었습니다. 나는 ibooks에서 제대로 읽을 수있는 샘플 epub 책을 가지고 있습니다. 감사. – user3205472
안녕하세요 @ user3205472 iOS의 UIWebView에서 book.html 파일의 페이지를 깨뜨리는 방법을 알려주세요. – BADRI