ios - UIWebView content not adjusted to new frame after rotation -
I have an e-mail application that shows content in a The problem is, when I zoomed in / out in Addional information: When selecting a code above the picture Edit: Solution !! I managed to solve it by updating the width of the viewport rotating device After doing UIWebView Code> UISplitViewController .
As long as I do not already zoom in / out the device, until everything goes well in UIWebView . When rotating the device, I adjust the frame of
UIWebView in
- (zero) Will AnimatorationInterface Orientation: (Interface Orientation) from Interface Orientation: (NSTInInvail) Period < / Code>
UIWebView and then rotate the device.
The material has not been changed to a new frame, which leads to a gray / black border in the material, or the content can be horizontally scrolled. UIWebView is a subview on a
UIScrollView which can be scrolled when
UIWebView is fully visible
scrollEnabled is
UIScrollView disabled and can be scrolled by
UIWebView .
UIWebView Shows.
It is the state before roaming in both cases.
[zoomed in before rotation Has been on top of the picture shows that the UIWebView content is changing it to a new frame correctly.
[zoomed before rotation] UIWebView code> above the photo after zooming in landscape and then rotating on the image - & gt; The content has not been displayed correctly
UIWebView.scrollView information
- (zero) didRotateFromInterfaceOrientation: Interface Orientation (UIInterfaceOrientation) :
& lt; _UIWebViewScrollView: 0xb1322a0; Frame = (0; 768 960); Clip Tubons = Yes; Autoresc = h; Inspirator = & lt; NSArray: 0xb1321d0>; Layer = & lt; CALayer: 0xb132270 & gt ;; Content Offset: {0, 0} & gt; The frame is right!
and I update the width of the viewport after rotating the device managed to solve it
Sijiflot Fll_vidth = self.view.frame.size.width; NSString * adsl_javascript_string = [NSString stringWithFormat: @ "var setViewPortScript = document.createElement ( 'meta'); \ setViewPortScript.setAttribute ( 'name', 'viewport'); \ setViewPortScript.setAttribute ( 'content', 'width =% f '); \ Dokyumentkgetelementsbitgnme (' head ') [0] Kappendcild (Setvievportskript); "Fl_vidth]; [Adsc_webview stringByEvaluatingJavaScriptFromString: adsl_javascript_string];
CGFLOTFlowWidth = self.view.frame.size.width; NSString * adsl_javascript_string = [NSString stringWithFormat: @ "var setViewPortScript = document.createElement ( 'meta'); \ setViewPortScript.setAttribute ( 'name', 'viewport'); \ setViewPortScript.setAttribute ( 'content', 'width =% f '); \ Dokyumentkgetelementsbitgnme (' head ') [0] Kappendcild (Setvievportskript); "Fl_vidth]; [Adsc_webview stringGuidelinesWriting frame strings: adsl_javascript_string];
Comments
Post a Comment