0
有一個按鈕,當我點擊按鈕時,我想旋轉圖像180,但它只適用於我第一次點擊該按鈕時,如何繼續旋轉圖像,謝謝提前? 下面是我的源代碼:如何繼續旋轉圖像
- (IBAction)touchButton_Refresh {
photo *photos = [photoArray objectAtIndexhotoIndex];
NSData *xmlData = [NSData dataWithContentsOfFilehotos.localPath];
UIImage *image;
if ([xmlData isKindOfClass:[NSData class]]) {
image = [[UIImage imageWithData:xmlData] retain];
}
SlideItem *slideItemRotate;
if (toOrientation == 1 || toOrientation == 2) {
slideItemRotate = [[SlideItem alloc] initWithFrame:CGRectMake(768*photoIndex, 0, 768, 980)];
}
else if (toOrientation == 3 || toOrientation == 4) {
slideItemRotate = [[SlideItem alloc] initWithFrame:CGRectMake(1024*photoIndex, 0, 1024, 700)];
}
slideItemRotate.photoImageView.image = image;
CGAffineTransform rotation = CGAffineTransformMakeRotation(3.14159265);
[slideItemRotate.photoImageView setTransform:rotation];
[[[slideScrollView subviews] objectAtIndex:0] removeFromSuperview];
[slideScrollView addSubview:slideItemRotate];
[slideItemRotate release];
}