Skip to content

Instantly share code, notes, and snippets.

@wbarksdale
Created August 27, 2013 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wbarksdale/6357024 to your computer and use it in GitHub Desktop.
Save wbarksdale/6357024 to your computer and use it in GitHub Desktop.
UIScrollView sucks
self.frame = newframe;
self.unstackedRect = newframe;
self.subview.frame = CGRectMake(self.subview.frame.origin.x,
self.subview.frame.origin.y,
self.imageViews.count * 98,
99);
self.contentSize = CGSizeMake(self.imageViews.count * 98, self.subview.frame.size.height);
[self setScrollEnabled:YES];
[UIView animateWithDuration:.5f
delay:0.0f
options: UIViewAnimationOptionCurveEaseOut
animations:^{
for(int i = 1; i < self.imageViews.count; i++){
UIImageView *iv = [self.imageViews objectAtIndex:i];
float newx = (98 * i) + 9;
iv.center = CGPointMake((iv.center.x + newx), iv.center.y);
}
} completion:^(BOOL finished) {
NSLog(@"donezo");
[self setNeedsDisplay];
[self.subview setNeedsDisplay];
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment