Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 03-03-2010, 09:36 PM   #1 (permalink)
gerakis
Registered Member
 
Join Date: Jan 2010
Posts: 12
gerakis is on a distinguished road
Default Extremely Simple UIPageControl help

I have made a scroll view with 3 pages. It's 960x460 pixels, exactly 3 pages. I made it using Interface Builder and linked it up.

Paging is working perfectly. There is a nice smooth scroll between pages.

However, I would like to get UIPageControl working as well, to show which page the user is on and give them another scrolling option. I cannot for the life of me figure out how the apple example works. They don't even have a scroll view or a UIPageControl in their nib file as far as I can tell! What kind of witchcraft is this?!

I want to hook the UIPageControl into my scrollview using interface builder if possible. It doesn't need to handle infinite pages or anything crazy like that, just the 3 I already have.

Code:
.h

@interface PagingTestViewController : UIViewController  {

	IBOutlet UIScrollView *scrollView;
	IBOutlet UIPageControl *pageControl;
}

@end



.m

- (void)viewDidLoad {
    [super viewDidLoad];
	
	[scrollView setContentSize:CGSizeMake(960, 460)];
	[scrollView setClipsToBounds:YES];
	scrollView.backgroundColor = [UIColor blackColor];
	scrollView.scrollEnabled = YES;
	scrollView.pagingEnabled = YES;
	scrollView.bounces = YES;
	scrollView.directionalLockEnabled = YES;
}
Is there an easy way this can be done?
gerakis is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,530
Threads: 94,051
Posts: 402,637
Top Poster: BrianSlick (7,979)
Welcome to our newest member, kaidm80
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:22 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.