Core Animationなどをポリポリ研究

  1. Animatable UIView properties

    UIViewのPropertyのいくつかはアニメーション可能

    http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/AnimatingViews/AnimatingViews.html

    Animatable UIView properties

    に書いてある

    だがしかし、それだけではなくて

    UIScrollViewのcontentOffsetも

    - (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated

    があるように、アニメーションできる。

    ということは、ドキュメントには書いてないけど

    UIScrollViewのcontentOffsetはAnimatable Propertyである。

    ので、

        [UIView beginAnimations:nil context:NULL];

        [UIView setAnimationDuration:10];

        [scrollView setContentOffset:CGPointMake(0, 500)];

        [UIView commitAnimations];

    とやると、10秒でスクロールする。

    たぶん、animatedという引数があるやつは全部この方法でアニメーション時間や、Timing Function(アニメーションのカーブ)が変更できる。



Theme = Manuscript Neue