XpApp
XpApp

Reputation: 141

UIPagecontrol with Images

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?

Upvotes: 1

Views: 1415

Answers (2)

Abhilash Reddy kallepu
Abhilash Reddy kallepu

Reputation: 545

-(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.

Upvotes: 1

parilogic
parilogic

Reputation: 1179

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

Upvotes: 0

Related Questions