[英]UIView does not move a subview when a animation block is after it
我有这个UIView
类。 它具有4个视图:
self.view
类本身的视图。 UIImageView
。 self.view
的框架为(30, 380, 68, 66);
self.view
(30, 380, 68, 66);
我希望能够UIViewAnimationTransitionFlipFromRigh
该按钮,然后将其放大并伴随UIViewAnimationTransitionFlipFromRigh
t。 在动画开始之前,我将类的框架设置为整个屏幕。 (我必须这样做,以便班级仍然要响应触摸),这就是我的按钮移至左上方的位置。 我正在做一个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。 这是为什么?
因为self.view中心是34、33。
而是尝试更改帧的原点(x或y)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.