iphone - UIView scaling during animation -
I have a custom UIView, which is to show a tile image.
- (zero) direct: (CGRTact) Rect {... CGContextRef Reference = UIGraphicsGetCurrentContext (); CGContextClipToRect (Reference, CGRectMake (0.0, 0.0, rect.size.width, rect.size.height)); CGContextDrawTiledImage (reference, imageRect, imageRef); ...} Now I am trying to resize that scene.
[UIView startAnimations: zero reference: zero]; [UIView Set Animation Duration: 0.3]; // Change the view frame [UIView commitAnimations]; What do I expect for the tiled area, what happens instead of leaving the tile size continuously, when the area grows, the original content of the scene increases in new size . At least during the animation, all the good at the beginning and end of the animation. Tiles become distorted during the animation.
Why is the CA trying to scale? How can I stop doing this? Did i remember
If the core animation has to call back in your code for every animation frame, never too fast May be, and the custom properties animation has long-requested feature and frequently asked questions for CA on Mac.
UIViewContentModeRedraw is on the right track, and it is also the best that you will get from CA. The problem is from the view of the UIKit point, there are only two values in the frame: the value at the beginning of the transition and the value at the end of the transition, and that is what you are looking for. If you look at core animation architecture documents, you will see that CA has a personal representation of all the layer properties and their values change over time. This is where the frame is being interpolated, and you can not be informed about the changes as it is happening.
So there is only one way to change the view frame with the NSTimer (or display: object with: later: ) over time, Old fashioned way
Comments
Post a Comment