0

ページング付きの ScrollView があり、 scrollView に画像のある配列に移動するボタンがあります..これが私のコードです

-(IBAction)scrollToPage:(id)sender {
    int scrollToPage = 1; 
    int scrollToX = 1-1; 
    [self.scrollView scrollRectToVisible:CGRectMake(scrollToX*self.scrollView.frame.size.width,0,self.scrollView.frame.size.width,self.scrollView.frame.size.height) animated:YES];
}

既にアニメーション化されていることはわかっていますが、カスタム アニメーションを追加する必要があります。たとえば、「水平反転、クロス ディゾルブなど」です。

ありがとうございます

4

1 に答える 1

1

次のコード スニペットを使用して、button pressedアクション メソッドにある画像を反転できます。これにより、画像を反転させることができ、それをいじって思い通りにすることができます。

UIImage* sourceImage = [UIImage imageNamed:@"whatever.png"];
UIImage* flippedImage = [UIImage imageWithCGImage:sourceImage.CGImage 
                     scale:1.0 orientation: UIImageOrientationUpMirrored];

これがうまくいくかどうかを確認してください。

于 2012-12-09T21:17:16.377 に答える