Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I found that to add properly formatted (readable) code blocks, I couldnt use comments. It was suggested I use an answer as an update to my original questions. So here it is.</p> <p>UPDATE</p> <p>I modified my code like this. As always, viewDidLoad calls createUIViews which does this:</p> <pre><code>-(void)createUIViews{ UIImage *image1 = [UIImage imageNamed:@"GiftCard.png"]; firstView = [[UIImageView alloc] initWithImage:image1]; CGRect newFrame1 = firstView.frame; newFrame1.origin.x = 50; newFrame1.origin.y = 10; firstView.frame = newFrame1; UIImage *image2 = [UIImage imageNamed:@"MyCard.png"]; secondView = [[UIImageView alloc] initWithImage:image2]; CGRect newFrame2 = secondView.frame; newFrame2.origin.x = 350;//CGRectGetWidth(firstView.superview.frame)/2; newFrame2.origin.y = 10; secondView.frame = newFrame2; //Add all Views offscreen except #1 [self.scrollView addSubview:firstView]; //added ONSCREEN [self.scrollView addSubview:secondView]; //added OFFSCREEN } </code></pre> <p>This sets the firstView onscreen and the secondView off to the right. </p> <p>The gesture recognizers are also set in viewDidLoad. They call swipeNext as it is below:</p> <pre><code>-(void)swipeNext:(id)sender{ //0 Get the currentview as referenced by pageControl oldView = [views objectAtIndex:currentViewIndex]; //MOVE ON TO NEW VIEW currentViewIndex ++; newView = [views objectAtIndex:currentViewIndex]; //1 Animate out the old view **(Aaron, youre right, dont need this anymore)** //newView.frame = oldView.frame; //newView.center = CGPointMake(oldView.center.x + CGRectGetWidth(oldView.frame), oldView.center.y); //[oldView.superview addSubview: newView]; [UIView animateWithDuration:1.0 delay: 0.0 options: UIViewAnimationOptionCurveEaseIn animations:^{ newView.center = oldView.center; oldView.center = CGPointMake(oldView.center.x - CGRectGetWidth(oldView.frame), oldView.center.y); } completion:nil]; </code></pre> <p>} I commented out the addSubview because I moved it to the createUIViews method. It works the same, I think its just a matter of swiftness or some animation feature that Im missing. I wish I could add a video. The original DD apps looks to be quicker to animate as a UIPageControl would (i think) Here is a link to a video.<a href="http://www.youtube.com/watch?v=SwwRgR5lYeM" rel="nofollow">Sluggish iOS UIView Animation</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload