w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How would I create a UIView with two UIWebViews and another UIView and dynamically change the parent UIView size to contain the content views?

Your view structure should look like this. View Controller -> View -> Scroll View -> View -> All your other stuff.

In your webViewDidFinishLoad method you will want to calculate the height of the content in the UIWebview. Once you have calculated that height set your UIWebview you use that height and reload them. Once the Webview height had been calculated via the content but not applied, you can calculate the total height of all your other stuff.

Take the height of all your other stuff and apply it to your View just inside the scroll view. For scrolling to work you will need to make sure that your scroll view height is actually smaller than the height of it's contents (the view containing all your other stuff).

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.