Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Core Animation animations are performed on a separate thread. When you enclose the change in contentOffset in a beginAnimations / commitAnimations block, that change will be animated gradually. The scrolling text view rotation that occurs next, outside of the animation block, will be performed instantly. Since both are interacting with the same control on different threads, it's not surprising that you're getting weird behavior.</p> <p>If you want to animate the rotation of the text in the same way as the contentOffset, move that line of code to within the animation block.</p> <p>If you want to have the rotation occur after the offset change animation has completed, set up a callback delegate method. You can use code in the beginning of your animation block similar to the following:</p> <pre><code>[UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(contentOffsetAnimationHasFinished:finished:context:)]; </code></pre> <p>which requires you to implement a delegate method like the following:</p> <pre><code>- (void)contentOffsetAnimationHasFinished:(NSString *)animationID finished:(BOOL)finished context:(void *)context; { // Do what you need to, now that the first animation has completed } </code></pre> <p>EDIT (2/6/2009): I just created a simplified version of your application, using only the sideways text scrolling, and find no problem with the animation on the device with any number of characters. I removed all extraneous calls to layout the buttons, etc., and only animate the text. Rather than apply the rotation transform to the scroll view every time you click the button, I have it start rotated and stay that way. </p> <p>I thought it might be a layer size issue, as the iPhone has a 1024 x 1024 texture size limit (after which you need to use a CATiledLayer to back your UIView), but I was able to lay out text wider than 1024 pixels and still have this work.</p> <p>A full Xcode project demonstrating this can be downloaded <a href="http://www.sunsetlakesoftware.com/sites/default/files/TestOfRotatingText.zip" rel="nofollow noreferrer">here</a>. I don't know what your issue is, but it's not with the text animating code you present here.</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. 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