Strange UIWebView issue after upgrading to Xcode8
Strange UIWebView issue after upgrading to Xcode8
- Subject: Strange UIWebView issue after upgrading to Xcode8
- From: Diederik Meijer <email@hidden>
- Date: Mon, 19 Sep 2016 11:30:59 +0200
Dear list,
In my app I have a horizontal UIStackView that has three UIViews, each of which has a UIWebView.
The UIStackView is embedded in a UIScrollView. The scrollView’s frame equals the viewController’s view’s frame, its content size is three times the viewController’s view’s width.
This operates as an infinite carousel for text content.
The whole view hierarchy is created in IB and uses auto layout. Platform is iOS, source code used Objective-C and Swift 2.3.
The problem I have is that when the user rotates the device, the UIWebViews embedded in the UIStackView don’t fill their entire size.
A part of the right hand side of the UIWebViews is not used/filled by the UIWebView, instead it is revealing the UIWebView’s superView.
The size of this unused part increases with every subsequent rotation.
I have tested the frame size width for both the UIWebView and its scrollView in the didRotateFromInterfaceOrientation function, those numbers are fine and stable, they don’t change no matter how many times I rotate the device. This suggests that auto layout is working as expected.
So while both these width parameters keep returning 634.5 for landscape orientation and 447.5 for portrait orientation, the webView’s visible content size is shrinking a little bit with every rotation.
I have tried various suggestions found on Stackoverflow, even adding a viewport metatag with the correct width before reloading the web view’s content after each rotation.
None of these seem to fix this issue.
Has anybody here run into this issue and are there any pointers towards a solution?
Many thanks,
Diederik
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden