Does iPhone OS support implicit animation?

后端 未结 2 1495
走了就别回头了
走了就别回头了 2021-01-16 12:53

Example from Mac OS X:

[[aView animator] setFrame:NSMakeRect(100.0,100.0,300.0,300.0)]; 

I have tried something similar in UIKit, but it se

2条回答
  •  忘掉有多难
    2021-01-16 13:09

    The iPhone supports implicit animation, though it does not use an animator object, it is built directly into UIView. Try this instead:

    [UIView beginAnimations:nil context:nil];
    [aView setFrame:NSMakeRect(100.0,100.0,300.0,300.0)];
    [UIView commitAnimations];
    

    The exact details are documented here.

    Every view is always layer backed as well, so you don;t have to turn on layers in order to get a layer for explicit animation.

提交回复
热议问题