1

I'm trying to use the page control feature along with UIScrollView to display a set of images on my IOS app, i've seen some tutorials but they all show how to change colors, how can i have some images loaded and use page control to go through them?

XpApp
  • 141
  • 4
  • 14

2 Answers2

1
-(void)loadScrollViewWithPage:(int)page;
{
    UIImageView *img=[[UIImageView alloc]initWithFrame:CGRectMake(scrollView.frame.size.width*page, 200, scrollView.frame.size.width, 100)];
    img.image=[UIImage imageNamed:[viewControllers objectAtIndex:page]];

    [scrollView addSubview:controller.view];
}

viewControllers stores the name of the image that you have taken.

nhahtdh
  • 55,989
  • 15
  • 126
  • 162
0

Using PageControl, you can navigate through views, so you can put imageviews on the view and set the images on imageviews.

parilogic
  • 1,147
  • 9
  • 26
  • but how do you navigate between views the example i've seen they just use background colors – XpApp Jul 12 '12 at 12:16