0

Context

I'm creating a UIView to act as the "container view" (let's call it containerView) for a UIScrollView, this UIScrollView will then house a UIWebView. See this question for more context. Matching subview's width to it's superview using autolayout

Goal

Have the containerView, when created, be "full screen", i.e. take up the whole screen. I can then tie the containerView's size, through auto-layout constraints to the UIWebView and make the UIWebView, be full width of the screen.

Questions

  • What is the best strategy for this? Using [[UIScreen mainScreen] applicationFrame];
Community
  • 1
  • 1
drc
  • 1,905
  • 4
  • 22
  • 28
  • Do you have a controller for your view? If yes, make that the root controller of the window object and the view will be full screen size. – Krumelur Aug 20 '13 at 21:05

1 Answers1

0

Yes. You can try something like this:

UIView *view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
Mick MacCallum
  • 129,200
  • 40
  • 280
  • 281
barryjones
  • 2,149
  • 1
  • 17
  • 21