我的目标是我的动画UI,和我使用UIView的动画。问题是我需要同时进行多个动画,但显然我一次只能执行一个UIView动画。我之前在这个主题上提出过问题(Multiple UIView Animations),所有响应者都说我必须用animationDidStop:performSelector:
这样的方法设置一个委托给动画,但我想知道是否可以将子视图添加到主视图并同时执行动画每个子视图。另外,我无法执行背靠背动画,我想也许我可以在view1上执行动画,然后在view上执行动画而不进行委托。的UIView子视图的动画
例如:
//Header
@property (nonatomic, strong) UIView *view1;
@property (nonatomic, retain) UIView *view2;
//Implementation
@synthesize view1;
@synthesize view2;
//ViewDidLoad
view1 = [[UIView alloc]initWithFrame:CGRectMake(0,0,480,640)];
view2 = [[UIView alloc]initWithFrame:CGRectMake(0,0,480,640)];
view1.backgroundColor = [UIColor clearColor];
view2.backgroundColor = [UIColor clearColor];
[performAnimationsOn View1]; //I don't know the code I would put here because the code
//I usually use is [UIView beginAnimation:@"animation"
//context:nil]; but that is a class method and I am not
//sure how to perform an animation on a specific subview.
[performAnimationsOn View2];
啊..确定虐待更新我的答案 –
请检查更新的答案:) –
是在执行。 M档 –