spaceman-labs / smpagecontrol Goto Github PK
View Code? Open in Web Editor NEWA drop in replacement for UIPageControl with a slew of additional customization options.
License: MIT License
A drop in replacement for UIPageControl with a slew of additional customization options.
License: MIT License
UIPageControl docs say the following about currentPage:
"Values outside the possible range are pinned to either 0 or numberOfPages minus 1."
SMPageControl currently ignores page indexes that are out of bounds.
Thanks for open sourcing this component.
I noticed that SMPageControl intrinsicContentSize
does not behave like UIPageControl.
In particular, it returns UIViewNoIntrinsicMetric
for the width whereas UIPageControl calculates a width based on the number of pages.
Without this, SMPageControl is not a drop in replacement for UIPageControl.
Is there a way to have the name of the page be the indicator?
As of today using variable dot sizes does not align properly (eg. current dot is bigger and so on). It seems dots are drawn (as per usual) left-aligned. Drawing dots centred-aligned is needed to be able to have variable dot sizes and still look good.
I currently try to implement the SMPageControler into my Swift 2.3 Project.
Xcode 8 Final Version.
pageControl.tapBehavior = SMPageControlTapBehavior.Jump
When I touch the Controler, the image gets selected, but the Screen does not jump to the new ViewController.
Any ideas?
Hello, i have been using this lib for a while, and did not have any issue till now. I opened an app on iOS 12 and wherever i have one page in SMPageControl that page indicator (dot) is not visible, also it looks like even if i have more than one it is visible but less, like view is smaller.
I did some research and found this "hidesForSinglePage" property, but it is always false.
Anyone with same issue?
Is there a way to "center" the current item? (within the self.view)
like let's say I have a PageController with 5 Views.
I want
| | = the window
i = the current item
. = items
is something like that possible? and how?
and please, if possible in swift code.
I've use pod to be able to use this framwork within my swift project.
I am thinking of implementing a feature in SMPageControl that will resize the indicators when there are too many to fit in the bounds width. I was thinking it would be set on a boolean flag (defaulting to NO) like resizeIndicatorsToFitBounds
. Then, a transform could be applied, or a recalculation of the sizing would be done if the sizeToFit
bounds width > actual bounds width. Thoughts?
I don't seem to find a public way to remove the image masks.
The app which I'm working on has rectangle images for indicators.
So changing the following line:
CGContextFillEllipseInRect(context, CGRectMake(centeredXOffset, yOffset, _indicatorDiameter, _indicatorDiameter));
to:
CGContextFillEllipseInRect(context, CGRectMake(centeredXOffset, yOffset, _indicatorDiameter, _indicatorDiameter));
did it for me.
Could you provide a public way of disabling image masks for ease of use?
Upon including the following:
github "Spaceman-Labs/SMPageControl"
in my Cartfile, I get the following:
*** Skipped building SMPageControl due to the error:
Dependency "SMPageControl" has no shared framework schemes for any of the platforms: iOS
If you believe this to be an error, please file an issue with the maintainers at https://github.com/Spaceman-Labs/SMPageControl/issues/new
Am I missing something?
Hi,
I been using your control for one of my project. Since I started using sdk 8 its been crashing my app.. The issue is in SMPageControl - - (void)_renderPages:(CGContextRef)context rect:(CGRect)rect
The error is thrown when we try to navigate the images.
The code that is throwing the error
yOffset = [self _topOffsetForHeight:image.size.height rect:rect];
CGFloat centeredXOffset = xOffset + floorf((_measuredIndicatorWidth - image.size.width) / 2.0f);
[image drawAtPoint:CGPointMake(centeredXOffset, yOffset)];
indicatorRect = CGRectMake(centeredXOffset, yOffset, image.size.width, image.size.height);
Not sure how to fix it. I ended up using the code in the else statement. Seems to be working for me for now
Thanks in advance
I use this code:
self.pageControl = [[SMPageControl alloc] initWithFrame:CGRectMake(110, 496, 100, 10)];
self.pageControl.numberOfPages = 6;
self.pageControl.currentPage = 0;
// green point
[self.pageControl setPageIndicatorImage:[UIImage imageNamed:@"page-dot.png"]];
//white large point
[self.pageControl setCurrentPageIndicatorImage:[UIImage imageNamed:@"page-dot-current.png"]];
[self.pageControl setImage:[UIImage imageNamed:@"page-signup-dot.png"] forPage:5];
[self.pageControl setCurrentImage:[UIImage imageNamed:@"page-signup-dot-current.png"] forPage:5];
After run and scrolling, the first dot became a whitish border.
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.