【发布时间】:2010-05-25 06:45:26
【问题描述】:
我有这个UIView 课程。
它有 4 个视图:
-
self.view班级观 本身。 - 在 twitterButtonView 上方:
- 一个按钮的
UIImageView。 - 上方是按钮背面的隐藏视图。
self.view 的框架为(30, 380, 68, 66);
我希望能够点击按钮,然后它会随着UIViewAnimationTransitionFlipFromRight 放大。在动画开始之前,我将类的框架设置为整个屏幕。 (我必须这样做才能让班级仍然响应触摸)这就是我的按钮移动到左上角的地方。我正在做一个twitterButtonView.center = somePoint 并且按钮视图没有任何反应:(我删除了不重要的部分)
// I save the center of the class. Its where the the class is in the window.
oldCenter = self.center;
self.frame = CGRectMake(0, 0, 320, 480);
// Set the button to the position where the class was.This is x=63 y=413 in the debugger
// If I return; after this everything is fine and the class has the frame set to the whole
// screen and the button is at 62,413
twitterButtonView.center = oldCenter;
[UIView beginAnimations:@"twitterButtonFlip" context:nil];
[UIView setAnimationDuration:1.0];
twitterButtonView.center = CGPointMake(160,220);
[UIView commitAnimations];
按钮移动到中心。但是动画起点是34,33。这是为什么呢?
【问题讨论】:
标签: iphone objective-c animation uiview