The scroll bar of the iOS web view changes by half.

Using Xcode 5, iOS 7.

Problems arise after changing the frame of the web view (0, 45, 320, 568 - 20 - 45 - 49) to (0, 0, 320, 568-20) or changing it back, its control is a container with a frame (0, 20, 320, 548) in the root manager of the application window.

When you change the frame of the web view back (0, 45, 320, 568-20-45-49) into its container, the web view is in the range from 65 to (568-449) vertically, but its scroll bar scrolls from 65 to the middle of the web presentation.

0
source share
1 answer

Decision

Finally, I worked on this:

[[[_webViewContainer webView] scrollView] setScrollIndicatorInsets:UIEdgeInsetsMake(0, 0, 0, 0)];

, - -, UIWebViewDelegate.

-(BOOL)webView:shouldStartLoadWithRequest:navigationType

, , ( -) .

:

UIEdgeInsets tempEdgeInsets;
tempEdgeInsets = [[_webView scrollView] scrollIndicatorInsets];
NSLog(@"scroll view edge insets = %f, %f, %f, %f", tempEdgeInsets.top, tempEdgeInsets.bottom, tempEdgeInsets.left, tempEdgeInsets.right);

, - tempEdgeInsets.bottom 520 - , .

0

All Articles