-1

Possible Duplicate:
iPhone Image slideshow

I want to do a simple slideshow with 6 images but i have any idea on how to do that. It's with UIPageControl ? there are a tutorial ?

Community
  • 1
  • 1
user567
  • 3,712
  • 9
  • 47
  • 80

4 Answers4

0

If its UIPageViewController, in your root view controller, call the method

- (void)setViewControllers:(NSArray *)viewControllers direction:(UIPageViewControllerNavigationDirection)direction animated:(BOOL)animated completion:(void (^)(BOOL finished))completion

Call this method in a timer.

Satyam
  • 15,493
  • 31
  • 131
  • 244
0

It depends on the way you want to show the images. There are ways to acheive this result, NSTimer,UIPageControl with ScrollView(image Change towards right hand side direction) ,ImageView.animationImages method(change is instant with no animation).

Anil Kothari
  • 7,653
  • 4
  • 20
  • 25
0

You can use a UIScrollViewController. So, when you have, for example, an array of image names, you can do something like

for(NSString *imageName in imageNames){
    UIImageView *image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:imageName]];
    image.frame = CGRectMake([imageNames indexOf:imageName] * SCREENWIDTH, 0, SCREENWIDTH, SCREENHEIGHT);
    [scrollView addSubview:image];
    [image release];
}

Be sure to select the Paging Enabled option for the scrollView in Interface Builder. Now you can do a slideshow with your fingers. If you want it to be automatic you can also use

[self performSelector:@selector(slide) withObject:nil afterDelay:1];

And in another function

-(void)slide{
    [scrollView setContentOffset:CGPointMake(/*calculate X axis offset*/,0) animated:YES]
}
Sergio Campamá
  • 746
  • 1
  • 7
  • 14
-1

even you can do it with nstimer

Prashant Bhayani
  • 692
  • 5
  • 18