Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>you cannot fade-out a UIView (the scroller) AND simultaneously fade-in the same view...</p> <p>you could just using different UIViews...</p> <p>what you can do is: </p> <p>1) fadeOut the scroller in the current position (to the backGround)</p> <p>2) while the scroller is invisible, move it to the right position (with no animation)</p> <p>3) fadeIn the scroller from the backGround</p> <p>something like:</p> <pre><code>// START FIRST PART OF ANIMATION [UIView animateWithDuration:0.5 delay:0.0 options: options:UIViewAnimationOptionTransitionCrossDissolve|UIViewAnimationOptionAllowAnimatedContent animations:^{ pagingScrollView.alpha = 0; } completion:^(BOOL finished) { // FIRST PART ENDED // MOVE SCROLLER (no animation) pagingScrollView.contentOffset = CGPointZero; // START SECOND PART OF ANIMATION [UIView animateWithDuration:0.5 delay:0.0 options: options:UIViewAnimationOptionTransitionCrossDissolve|UIViewAnimationOptionAllowAnimatedContent animations:^{ // fadeIn - animated pagingScrollView.alpha = 1; } completion:^(BOOL finished) { // ANIMATION ENDED [self refreshPages]; }]; }]; </code></pre> <p><strong>NEW EDIT:</strong></p> <p>thanks to amadour, who taught me something with his comments,</p> <p>i hope he could add an answer of his own, i would vote for him</p> <p>anyway, to answer to jowie original question:</p> <p>i got the right animation just moving the contentOffset setting out of the animation block, and removing UIViewAnimationOptionAllowAnimatedContent (not really needed), and passing pagingScrollView as parameter for transitionWithView</p> <p>this worked for me:</p> <pre><code> pagingScrollView.contentOffset = CGPointZero; [UIView transitionWithView:pagingScrollView duration:3.0 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{ // pagingScrollView.contentOffset = CGPointZero; // move up, outside of animation block } completion:^(BOOL finished) { NSLog(@"--&gt;&gt; END amimation"); [self refreshPages]; }]; </code></pre>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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