Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed "Flickering effect" when only 2 subviews are used in FlickView
  • Loading branch information
robertpanzer committed Jul 7, 2012
1 parent 31bbe17 commit 7c254aa
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Github To Go/RPFlickViewController.m
Expand Up @@ -288,13 +288,20 @@ -(void)pan:(UIPanGestureRecognizer*)sender {
}
} else {
[UIView beginAnimations:@"swipe" context:nil];
if (self.titles.count > 2 || translation.x > 0) {
if (self.titles.count > 2) {
self.leftViewController.view.frame = CGRectMake(-self.view.frame.size.width, 20.0f, self.view.frame.size.width, self.view.frame.size.height - 20.0f);
}
self.currentViewController.view.frame = CGRectMake(0.0f, 20.0f, self.view.frame.size.width, self.view.frame.size.height - 20.0f);
if (self.titles.count > 2 || translation.x < 0) {
if (self.titles.count > 2) {
self.rightViewController.view.frame = CGRectMake(self.view.frame.size.width, 20.0f, self.view.frame.size.width, self.view.frame.size.height - 20.0f);
}
if (self.titles.count == 2) {
if (self.leftViewController.view.frame.origin.x < 0) {
self.leftViewController.view.frame = CGRectMake(-self.view.frame.size.width, 20.0f, self.view.frame.size.width, self.view.frame.size.height - 20.0f);
} else {
self.leftViewController.view.frame = CGRectMake(self.view.frame.size.width, 20.0f, self.view.frame.size.width, self.view.frame.size.height - 20.0f);
}
}
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
[UIView commitAnimations];
Expand Down

0 comments on commit 7c254aa

Please sign in to comment.