1

I've almost pulled out all my hairs and I can't seem to find a solution. After searching and watching dozens of tutorials I'm asking here.

I have an iOS universal project in which I have only 1 webview. The whole project is set to landscape. Unfortunately it seems I cannot get this webview run in fullscreen. Whenever I have it running on my iPhone 5 the webview is only visible partially on my phone. The view is a square and centered horizontally and vertically. In landscape mode it reaches top to bottom but on the left and right side I have empty room the view did not reach.

Anyway I think it has something to do with the new storyboard feature stuff in xcode 6, but somehow I don't seem to be able to the make it working as I intend.

As said in the beginning I watched several tutorials but none of em where with only a fullscreen webview. If anyone can give me a push in the right direction I'd be glad.

Thanks in advance.

Edit: I've added a screenshot of my project: UIWebView

Rac00n
  • 73
  • 1
  • 7
  • I wonder what is the difference in this context between UIWebView and UIView... it would be better to see some screengrab – Injectios Jan 29 '15 at 14:34
  • Please see the edit - also I've tried to implement the solution by asifmohd without luck. The same problem persists. – Rac00n Feb 01 '15 at 13:46
  • Once you apply asifmohd's solution you need to update frames. – Cesare Feb 01 '15 at 13:56
  • Still not working :( - it all seems like as if the super view itself does not have the correct dimensions - totally strange – Rac00n Feb 04 '15 at 19:28

3 Answers3

1

Hold down 'Ctrl' on keyboard.

Click and hold down click the 'Web View' item in the 'view controller scene' content list on left.

Drag the 'Web View' item up to the 'View' item in the 'view controller scene' content list on left. ( You will see blue line to link the items )

A pop up menu will appear as to how you wish the two items to interact.

There you can select, 'Equals Width', and 'Equals Height'.

0

Reset all the constraints of the UIWebView and then add the following four constraints:

  • Trailing space to superview -16
  • Leading space to superview - 16
  • Top space to container/superview - 0
  • Bottom space to container/superview - 0

This will make the UIWebView fullscreen and centered to the UIView.

Cesare
  • 9,139
  • 16
  • 78
  • 130
asifmohd
  • 921
  • 7
  • 16
  • Isn't -20 the right constraint to go fullscreen (instead of -16)? -16 isn't fullscreen in iPad. – Cesare Jan 29 '15 at 14:47
0

I finally was able to found a solution to my problem. Thanks for everybody who tried to help me - it seems I was unable to properly describe my problem.

The solution to my problem was found here:

Black bars showing when running app on iOS 7 (4 inch retina display)

Community
  • 1
  • 1
Rac00n
  • 73
  • 1
  • 7