【发布时间】:2010-06-15 15:11:06
【问题描述】:
我有一个想要使用动画在左侧扩展的视图。除左侧外的所有边框都应保持不变,因此视图的 x 位置和宽度会发生变化。
我使用这个代码:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:5.0];
self.frame = CGRectMake(self.frame.origin.x-100,
self.frame.origin.y,
self.frame.size.width+100,
self.frame.size.height);
[UIView commitAnimations];
如果我运行这段代码,视图的宽度会立即设置为新值,然后视图会移动到新的 x 点,但为什么呢?我该如何改变这种行为?
感谢您的想法!
【问题讨论】:
标签: objective-c iphone core-animation quartz-graphics