Well, I know that there are already many answers to my questions, but I tested each of them, and I still have a problem. I have a UIScrollView that contains a UIView, I want active autostart for animation. But because of this, my scroll does not scroll.
This is my code:
NSDictionary *viewsDictionary = NSDictionaryOfVariableBindings(_scrollView, _containerScrollView); [_scrollView setScrollEnabled:YES]; [_scrollView setContentSize:CGSizeMake(_scrollView.frame.size.width, CGRectGetHeight(_containerScrollView.frame))]; _scrollView.userInteractionEnabled = YES; _scrollView.delaysContentTouches = YES; [self.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_scrollView]|" options:0 metrics:0 views:viewsDictionary]]; [self.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_scrollView]|" options:0 metrics:0 views:viewsDictionary]]; [_scrollView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_containerScrollView]|" options:0 metrics:0 views:viewsDictionary]]; [_scrollView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_containerScrollView]|" options:0 metrics:0 views:viewsDictionary]];
Can someone explain to me why it is not working?
ios autolayout uiview constraints uiscrollview
Maxime
source share