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 

Many thanks,



Cocoa-dev mailing list (

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)

Help/Unsubscribe/Update your Subscription:

This email sent to

Reply via email to