Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rajivnarayana/pageswiperindicator
An Android style View Pager Indicator for iOS. Used in R.T iOS v2.0.
https://github.com/rajivnarayana/pageswiperindicator
Last synced: about 1 month ago
JSON representation
An Android style View Pager Indicator for iOS. Used in R.T iOS v2.0.
- Host: GitHub
- URL: https://github.com/rajivnarayana/pageswiperindicator
- Owner: rajivnarayana
- Created: 2012-08-04T20:53:12.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-08-04T21:02:33.000Z (over 12 years ago)
- Last Synced: 2023-03-25T21:13:09.583Z (almost 2 years ago)
- Language: Objective-C
- Size: 93.8 KB
- Stars: 8
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
Usage:
1. Drag and drop UIViewPager.h and UIViewPager.m files into your project.
2. Following modifications to your UIViewController. Look at WAScrollViewController for example usage.
//Add view pager.
UIViewPager *viewPager = [[UIViewPager alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 50)];
[self.view addSubview:viewPager];
viewPager.delegate = self;
scrollView.delegate = viewPager;3. Implement the delegate methods to provide titles and to handle taps on the titles.
#pragma mark UIViewPagerDelegate protocol implementation.
- (NSString *) titleForLabelForPage:(int)page {
if (page == 0) {
return @"All";
}
if (page == 1) {
return @"Tips";
}
return nil;
}- (void) switchToPageIndex:(int)page {
[scrollView setContentOffset:CGPointMake(page * scrollView.bounds.size.width,0) animated:YES];
}