nealyoung / nysegmentedcontrol Goto Github PK
View Code? Open in Web Editor NEWAnimated, customizable replacement for UISegmentedControl
License: MIT License
Animated, customizable replacement for UISegmentedControl
License: MIT License
the error info is:
Assertion failed: (CGFloatIsValid(x) && CGFloatIsValid(y)), function void CGPathMoveToPoint(CGMutablePathRef, const CGAffineTransform *, CGFloat, CGFloat), file Paths/CGPath.cc, line 254.
crash in this line:
UIBezierPath *roundRectBezierPath = [UIBezierPath bezierPathWithRoundedRect:self.maskFrame
cornerRadius:self.maskCornerRadius];
我调用这个方法,但是界面对文字没有改变
[self.graySegmentedControl setTitle:NSLocalizedString(@"exchange", @"exchange") forSegmentAtIndex:0];
Does not support 'iOS6'?
My goal is to make a "square" segmented control. It seems like cornerRadius affects the corner radius of the control, but regardless what value I set that to, the selectedSegmentIndicator maintains a 4.0f corner radius. I see in the code where that is set but I don't see way to adjust it. Based on that, I also don't get how the examples are possible...
In case Apple ever uses NY
as a prefix, it would be wise to conform to their conventions document and use a three-letter prefix.
When first loading the segmented control, the first text in the first selected segment is not properly rendered.
instead of
(after selecting another segment and back to the first one)
Note: the first image corresponds to the label when one is moving ("panning") the segment from one index to another and when the titles are being masked interactively. If I stop my finger over a title, it will look like pic. 1 but when I release my finger and the segment becomes selected, then it looks like pic. 2.
So the issue is that when first appearing, the selected segment is as in pic. 1 and not as is pic. 2.
Thanks.
How can I modify this to support selectedSegmentIndex
= UISegmentedControlNoSegment
I get this error when i set my minimum deployment target to iOS 7.1
(null): Object file (/Users/jatin/Library/Developer/Xcode/DerivedData/MyProject/Build/Products/Debug-iphonesimulator/libNYSegmentedControl.a(NYSegmentIndicator.o)) was built for newer iOS version (9.1) than being linked (7.1)
Can you recompile it with minimum target as iOS 7.1? Warnings are not very delightful to see. :(
I'd like to be able to set a corner radius on both the segmented control, as well as its indicator view. Rather than making properties on the segmented control that are passed to the indicator view, why not just expose the indicator view itself?
A segmentIndicator
could "refuse" to be selected.
There would different colors for the title of such a segmentIndicator.
What do you think?
Otherwise, your lib is great, thanxx!
Swipe is not working well and there is no disable option.
This for my work:
CGContextTranslateCTM(context, 0, self.frame.size.height + 1);
CGContextScaleCTM(context, 1.0, (CGFloat) -1.0);
But i think need to calculate the size of the characters...
UISegmentedControl can take UIImage during initialization but NYSegmentedControl only takes NSString. Could you fix this?
Thanks.
When you dragged the thumb to change section the second time, you will se see that the text ofthe current section stay the same color as selected
The solution that I found without modify the library is to make layoutSubviews on the control after the "index changed" event.
Is there a way to fix it in the library instead to make it like I do?(Surely)
Thanks
Hi,
I'm thinking of a new feature: adding a delegate:
@protocol NYSegmentedControlDelegate <NSObject>
- (void)segmentedControl:(NYSegmentedControl *)segmentedControl willSelectIndex:(NSUInteger)index ;
- (void)segmentedControl:(NYSegmentedControl *)segmentedControl didSelectIndex:(NSUInteger)index ;
- (void)segmentedControl:(NYSegmentedControl *)segmentedControl willUnselectIndex:(NSUInteger)index ;
- (void)segmentedControl:(NYSegmentedControl *)segmentedControl didUnselectIndex:(NSUInteger)index ;
@end
What do you think? Good idea? Easy to implement?
If you are OK, I can do a PR.
显示文字使用中文时出现BUG,1.3的版本中没有。
Is there anyway to set just the Bottom Border of the selected item?
Can you integrate changes from krzyzanowskim/NYSegmentedControl and update podSpec please? IBOutlet quite helpful
I tried [segmentedControl setSelectedSegmentIndex:UISegmentedControlNoSegment];
but it didnot work.
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.