mdinacci / mdradialprogress Goto Github PK
View Code? Open in Web Editor NEWA custom UIView useful to represent progress in discrete steps.
License: Other
A custom UIView useful to represent progress in discrete steps.
License: Other
I use the control to display the values from 0 to 10 with fractional values. if I set the value from 0.1 to 0.9 progress is not displayed. http://joxi.ru/6aLkU_3JTJBkZOHYqxA
How can I fix it?
I've been trying to change color smoothly with this approach:
[UIView animateWithDuration:10.0 animations:^{
self.progressView.theme.centerColor = [UIColor colorWithRed:0.15 green:0.3 blue:0.45 alpha:0.1];
}];
...but instead of a gradual shift it changes the color immediately.
Do you know why this doesn't work and how I might go about getting a smooth transition?
On iphone 6 plus the radilProgressView crashes on drawArcInContext giving EXEC_BAD_ACCESS error. Please help me what is the matter ?
It works one first start. then after going back to the view where the radial is placed. IT crashes ono following method.
(void)drawArcInContext:(CGContextRef)context center:(CGPoint)center radius:(CGFloat)radius startAngle:(CGFloat)startAngle
endAngle:(CGFloat)endAngle color:(CGColorRef)color clockwise:(BOOL)cgClockwise
{
CGContextBeginPath(context);
CGContextMoveToPoint(context, center.x, center.y);
CGContextAddArc(context, center.x, center.y, radius, startAngle, endAngle, cgClockwise);
CGContextSetFillColorWithColor(context, color);
CGContextFillPath(context); //crash on this point exc_bad_access
}
Hi,
when i connect the value of a slider and MDRadial, the view stay the same.
Thx.
Hi,
thanks for your control.
I've found a bug when loading it from a XIB, and trying to initialize it in the awakeFromNib method of my cell.
In fact, you've implemented the awakeFromNib constructor. A component loaded from a XIB should implement initWithCoder: instead.
When using your control in a UICollectionViewCell for example, and trying to configure it in the awakeFromNib method of the UICollectionViewCell, the awakeFromNib method of your control is called after. So configuration aren't kept.
CustomCollecitonViewCell.h
- (void)awakeFromNib
{
[super awakeFromNib];
MDRadialProgressTheme *theme = _progressView.theme;
theme.completedColor = [UIColor redColor];
theme.centerColor = [UIColor whiteColor];
theme.labelShadowColor = [UIColor blackColor];
// _progressView is an outlet defined in the xib
_progressView.theme = theme;
}
// Past this point, awakeFromNib method will be called in your MDRadialProgressView. Perhaps a change in iOS7 xib loading ?
To fix that, you have to replace your awakeFromNib method by the initWithCoder constructor.
Regards,
Hi,
I am developing a countdown updating the radial progress view every millisecond and I have detected a delay when I use this component on a big UIView added from .xib file.
Can it be caused by a redraw time delay?
Here's my code:
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self initViews];
self.timer = [NSTimer scheduledTimerWithTimeInterval: 0.01 target:self selector:@selector(updateCountdown) userInfo:nil repeats: YES];
}
-(void)updateCountdown {
self.progressView.progressCounter -= 1;
[self.lbCounter setText:[NSString stringWithFormat:@"%lu", (unsigned long)(self.progressView.progressCounter/100)+1]];
if (self.progressView.progressCounter == 0) {
[self.timer invalidate];
}
}
I'd appreciate it if you could take a look at it,
Thanks
Hi,
I think this method has no purpose actually. Was it supposed to enable support for shared theme accross application ?
Are you open to a pull request ?
I think we can handle a private dictionary, allowing use to return shared instance of themes accross application, allowing use for example to modify defaultTheme ?
Regards
as the image, i want the label can support richtext.
and i have implementation this function at https://github.com/erduoniba/MDRadialProgress,
also i pull request at #50
Thank you very much!
MDRadialProgress must provide information about its size to the Auto Layout system.
One issue caused by failing to do so is that the label is not displayed correctly when the frame is resized,
See #33 for more details.
hi,ios5.x support?
Here's my code:
self.approvalGraph.completedColor = [UIColor greenColor];
self.approvalGraph.incompletedColor = [UIColor grayColor];
self.approvalGraph.thickness = 5;
self.approvalGraph.sliceDividerColor = [UIColor colorWithWhite:244./255. alpha:1.0];
// Be sure to use the same color for background and sliceDivider to simulate
// the space between one step and another.
self.approvalGraph.backgroundColor = [UIColor colorWithWhite:244./255. alpha:1.0];
self.approvalGraph.progressTotal = 100;
self.approvalGraph.sliceDividerHidden = YES;
self.approvalGraph.sliceDividerThickness = 1;
int val = 50;
and this is what I get:
I want to set completed and incompleted thickness as different, but I don't find some property
Can not be very easy to control whether to display the percent sign, your project is not through the control switch, you may be able to add a bool attributes to control, I tried, realize, and convenient.
You may see this:
Add:
MDRadialProgressView.h
// 控制是否显示显示百分号
// whether or not
@property(nonatomic,assign) BOOL isShowPercentMark;
"MDRadialProgressView.m"
if (self.isShowPercentMark == YES) {
text = [NSString stringWithFormat:@"%.0f%%", percentageCompleted];
}else if (self.isShowPercentMark == NO){
text = [NSString stringWithFormat:@"%.0f", percentageCompleted];
}
Just reread your label implementation, seems that label don't own a theme.
So label refresh should be done by progress on theme update.
Is there a way to show the percentage symbol after the number ?
Can you have a progress animation here? I think it can perform better.
For some reason when I push a modal and then dismiss it, do a data refresh on my tableView the radialCharts redraw in a different x y position on my table view cells.. cannot figure out why but can see it setting to new.
A nice feature would be to animate the progress bar
Something I could work on if I ever have time but just throwing it out there...
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.