ios - UIWebView content not adjusted to new frame after rotation -


I have an e-mail application that shows content in a 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>

The problem is, when I zoomed in / out in 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.

Addional information: 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 .

Landscape_Correct When selecting a code above the picture UIWebView Shows.
It is the state before roaming in both cases.


portrait_width_juming
[zoomed in before rotation Has been on top of the picture shows that the UIWebView content is changing it to a new frame correctly.


Portrait_With_Zooming
[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!

Edit: Solution !!
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];

I managed to solve it by updating the width of the viewport rotating device After doing

  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

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -