title: Xcode UIScrollView layout - set horizontal content size and resize subviews horizontally
body: <p>I have a scroll view that takes up the entire screen for a view. In this scroll view, there are several text fields stacked vertically. Due to there being too many of these text fields, I am using a scroll view, so the user can scroll down. I am using Xcode's Preview so I can set the view up to work on many devices. The problem I have is that I want these text fields to change horizontal size to fit, so there is no horizontal scrolling; however I can never get them to change size. Rather, the scroll view just lets me scroll horizontally.</p>
  
  <p>I set this up in Xcode's interface builder (the scroll view and the text fields), and had Xcode apply all of its suggested constraints. Then, I put in a constraint for each of these text fields that set their right edges to be a set distance away from the scroll view (I could not set a distance from the actual view because the scroll view is the superview). These constraints did not clash with any existing constraints. There was no width set for any of these text fields by Xcode's suggested constraints.</p>
  
  <p>Then in the <code>viewDidLoad:</code> method: <code>[scrollView setContentSize:CGSizeMake([[UIScreen mainScreen] bounds].size.width, scrollView.contentSize.height)];</code></p>
  
  <p>This in an attempt to force the scroll view to use the super view's horizontal width. </p>
  
  <p>I am sorry about the vagueness of my question. <strong>Essentially, I need a way for text fields in a scroll view to resize horizontally to fit the screen.</strong> </p>