반전 애니메이션의 절반으로 UIImageView 이미지를 어떻게 바꿀 수 있습니까? 내 코드가 UIImageView를 뒤집어 성공적으로 이미지를 변경하는 것처럼 보이지만 순간적으로 바뀌고 있습니다. 내가 원하는 것은 180 플립이 90도 플립에 도달하면 이미지를 변경하는 것입니다.UIImageView 이미지를 반전 애니메이션의 절반으로 변경하십시오.
뷰에있는 UIImageView 만들기 : 여기 내 코드는 탭에
UIImage *image = [UIImage imageNamed:@"fb1.jpg"];
imageView = [[UIImageView alloc] initWithImage:image];
vw = [[UIView alloc] initWithFrame:CGRectMake(20, 20, 80, 80)];
vw.layer.cornerRadius = vw.frame.size.width/2;
imageView.frame = CGRectMake(20, 20, 80, 80);
imageView.layer.cornerRadius = imageView.frame.size.width/2;
imageView.layer.masksToBounds = YES;
imageView.layer.borderColor = [[UIColor blackColor] CGColor];
imageView.layer.borderWidth = 1.0;
[self.view addSubview: imageView];
//[self.view addSubview:vw];
[imageView setUserInteractionEnabled:YES];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(taptap:)];
[imageView addGestureRecognizer:tap];
애니메이션의 UIImageView : 또한
[UIView animateWithDuration:2.0 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut
animations:^(void) {
imageView.transform = CGAffineTransformMakeScale(-1, 1);
[UIView animateWithDuration:1.0 delay:1.0 options:UIViewAnimationOptionTransitionCrossDissolve
animations:^(void) {
imageView.image = [UIImage imageNamed:@"fb2.jpg"];
} completion:^(BOOL finished) {
}];
}
completion:^(BOOL finished) {
}];
, 나는 특정있는 UIImageView에 탭 제스처에이 애니메이션을하고있는 중이 야.
는 http://stackoverflow.com/questions/1194752/how-can-i-flip-a-uiimageview 내가 그 링크를 따라하려고 – iOS
대답은 내 둥근있는 UIImageView 광장을합니다. –