이제 iPhone 응용 프로그램에서 UIImageView를 사용하여 애니메이션을 만들고 잘 작동합니다. 그런 다음 애니메이션이 끝난 후 애니메이션을 한 번 호출하면 화면에 표시되는 버튼이 표시되지만 처음에는 해당 버튼이 표시됩니다. 애니메이션이 시작되면, 애니메이션이 완성되면 화면에 단추가 나타납니다.이 문제를 해결하는 방법은 무엇입니까?iPhone에서 UIImageView 애니메이션을 설정하는 방법은 무엇입니까?
- (void)viewDidLoad
{
[super viewDidLoad];
NSArray * imageArray = [[NSArray alloc] initWithObjects:[UIImage imageNamed:@"cardopen.png"],
[UIImage imageNamed:@"middlecard.png"],
[UIImage imageNamed:@"thirdcard.png"],
[UIImage imageNamed:@"a.png"],
[UIImage imageNamed:@"cardopen1.png"],
[UIImage imageNamed:@"middlecard2.png"],
[UIImage imageNamed:@"thirdcard1.png"],
[UIImage imageNamed:@"2.png"],
nil];
UIImageView * cardsImage = [[UIImageView alloc] initWithFrame:CGRectMake(10, 0, 400, 300)];
cardsImage.animationImages = imageArray;
cardsImage.animationDuration = 8.0;
cardsImage.animationRepeatCount=1; // one time looping only
[self.view addSubview:cardsImage];
[cardsImage startAnimating];
[self method1]; // To Call a method1 to show UIButton (Once the animation is completed, then to call a method1)
}
-(void)method1
{
UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn.frame=CGRectMake(10, 40, 50, 50);
[self.view addSubview:btn];
}
입니다. –
럼 귀하의 method1 8 초 지연 후 – Rajneesh071