我的目標是我的動畫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檔 –