ddeville / ddpagecontrol Goto Github PK
View Code? Open in Web Editor NEWAn easily customizable alternative to UIKit's UIPageControl
Home Page: http://www.ddeville.me
License: Other
An easily customizable alternative to UIKit's UIPageControl
Home Page: http://www.ddeville.me
License: Other
An easily customizable alternative to UIKit's UIPageControl DDPageControl redefines exactly every property and methods available in UIPageControl. Using DDPageControl without customization will actually lead exactly to a UIPageControl. However, the power of DDPageControl is that you can set some additional properties that will affect the way the look and feel of the page controls. There are two color properties: one for 'on' controls and one for 'off' controls. You are free to pass an alpha channel for any of these colors' You can also set the type of indicators you want as a filled circle or a simple ellipse. Finally, the diameter of every indicator and their spacing is also customizable by setting a couple of properties.
I'm implementing DD Page Control, but I have an issue regarding hiding the control when only one page is displayed. I have imported the DDPageControl class, and added to the main view controller the following code:
int numberOfPages = 1;
dotsControl = [[DDPageControl alloc] init] ;
[dotsControl setHidesForSinglePage:YES];
[dotsControl setCenter: CGPointMake(self.view.center.x, self.view.bounds.size.height-20.0f)];
[dotsControl setAutoresizingMask:UIViewAutoresizingFlexibleBottomMargin];
[dotsControl setNumberOfPages: numberOfPages];
[dotsControl setCurrentPage:0] ;
[dotsControl setDefersCurrentPageDisplay: YES] ;
[dotsControl setType: DDPageControlTypeOnFullOffEmpty] ;
[dotsControl setOnColor: [UIColor colorWithRed:(250.0/255.0) green:(170.0/255.0) blue:(0.0/255.0) alpha:1.0]] ;
[dotsControl setOffColor: [UIColor colorWithWhite: 0.7f alpha: 1.0f]] ;
[dotsControl setIndicatorDiameter: 7.0f] ;
[dotsControl setIndicatorSpace: 7.0f] ;
[self.view insertSubview:dotsControl belowSubview:thumbnailControl];
but dots are always drawed also on views of only 1 page
Hey Damien,
I wanted to add DDPageControl to CocoaPods, so people can use it even more easily in their own projects. However, it would be very helpful for me if you could tag the current branch with a version number, e.g. "0.1". That way we can create a pod file that will always work.
Thanks,
Chris
UITextAlignmentCenter is/was first deprecated in iOS 6.0.
Simply replace UITextAlignmentCenter by NSTextAlignmentCenter will do the job.
There are getting more errors when i try to update pod version.
pod 'DDPageControl', '~> 0.1.0'
If I comment out setFrame: and setBounds: then the component won't automatically resize itself, and works more closely like the original UIPageControl component. This is important for me because I need to add to the nib file so I can add constraints and position it correctly. Is there any need for resizing the component? It already aligns centre.
I am trying to change width of the control, to make it as wide as screen width:
DDPageControl *pageControl = [[DDPageControl alloc] init];
pageControl.numberOfPages = 4;
pageControl.currentPage = 0;
pageControl.indicatorDiameter = 5.0;
pageControl.frame = CGRectMake(0.0, 300.0, 320.0, 36.0);
This doesn't work for me, the width always equals to 100.0
How can I change this parameter?
Thanks.
Hello,
I am trying to understand some of the code in DDPageControl. Could you clarify the following:
// correct the bounds accordingly
self.bounds = self.bounds
setFrame:
and setBounds:
Why is bounds assigned to super's bounds, not self?super.bounds = aBounds;
Thanks!
If i add a lot of pages, the DDPageControl component extend its size beyond the size of the device.
I am trying to limit the width of the component, but how can I still show to the user where he is in the scrollview ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.