0

I have a ScrollView with paging and I have a button which takes me to an array with image in my scrollView .. Here's my codes

-(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];
}

I know it's already animated but I need to add custom animation to it for example :"flip horizontal, cross dissolve, etc"

Thanks in advane

emrys57
  • 6,679
  • 3
  • 39
  • 49
Abdelrahman Eid
  • 881
  • 2
  • 13
  • 28

1 Answers1

1

You can use the following code snippet to flip the image you have in your button pressed action method. This will allow the image to be flipped then you can play around with it to be what you want.

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

See if this works for you.

Adrian P
  • 6,479
  • 4
  • 38
  • 55
  • Thank you for your answer @Amp .. But actually the button doesn't take me to a specific to use your codes .. It takes me to an image with buttons it's the first array .. What I need to is modify my codes and add an animation to it .. is that possible ? ... anyway I voted up your answer and thank you for your interest :) – Abdelrahman Eid Dec 09 '12 at 22:47