Uiwebview doesn't scroll to the bottom

I'm new to the iPad developer,

I am making an ePub reader for my application in which I load ePub pages into UIWebView

when I load my pages in webview, it scrolls only to some limits,

here is my piece of code,

- (void)viewDidLoad {
...

    _webview=[[UIWebView alloc]init];
    _webview.frame=CGRectMake(0, 0, 770, 960);
    [_webview setBackgroundColor:[UIColor grayColor]];
    _webview.delegate=self;
    [self.view addSubview:_webview];

    [self loadPage];
...
}



 - (void)loadPage{

  [_webview loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:_pagesPath]]];

    [self._webview sizeToFit];
    _webview.scalesPageToFit=TRUE;
    _webview.scrollView.bounces = NO;
    _webview.autoresizesSubviews = YES;

}
+3
source share
3 answers

Delete the entire line and write only these lines,

_webview.scalesPageToFit=TRUE;
_webview.scrollView.bounces = NO;
+5
source

If you cannot scroll to the bottom end using UIWebView:

1) One way (software) to solve the problem is to use the correct auto sort before UIWebView.

self.webView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin ;

enter image description here

2) (Interface Builder) - UIWebView. Interface Builder- > Web View- > Size Inspector ( )

+2

1) try to hide the NavigationBar

self.navigationController.hidesBarsOnSwipe = YES;

2) Try making WebViewScale suitable for viewing

webView.scalesPageToFit=YES;
webView.scrollView.bounces = NO;

3) Or there may be a problem with Frame WebView, then try

UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-self.navigationController.navigationBar.frame.size.height)];
0
source

All Articles