title: Fixed / Float view in UIScrollView with AutoLayout
body: <p>In <a href="https://developer.apple.com/library/ios/technotes/tn2154/_index.html" rel="noreferrer">this technical Note</a> Apple states that you can make a subview of UIScrollView fixed / floating by adding constraints to UISCrollView's superview. I tried that but I'm doing something wrong and I can't figure out whats the problem.</p>
  
  <blockquote>
    <p>Note that you can make a subview of the scroll view appear to float (not scroll) over the other scrolling content by creating constraints between the view and a view outside the scroll view’s subtree, such as the scroll view’s superview.</p>
  </blockquote>
  
  <p>That's what I did. I have a UIScrollView already set up and try to add the fixed view to the top of the scrollview like the following:</p>
  
  <pre class="lang-c prettyprint-override"><code>_testOverlay = [[UIView alloc] init];
  _testOverlay.backgroundColor = [UIColor blueColor];
  _testOverlay.translatesAutoresizingMaskIntoConstraints = NO;
  [self.scrollView addSubview:_testOverlay];
  
  [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|[_testOverlay]|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(_testOverlay)]];
  [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_testOverlay(64)]-(&gt;=0)-|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(_testOverlay)]];
  </code></pre>
  
  <p>However, this does not work, the added view will move along with the scrollview and does not 'float'. Any ideas whats wrong here?</p>