Hello friends, today I have used a UIProgressView in my iOS application. I have created a custom UIProgressView programmatically. I found the basic code for this and sharing the same code with you. Hope you will find it helpful.
Code for adding custom UIProgressView iOS programmatically:
UIProgressView *progressView;
progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];  progressView.progressTintColor[UIColor colorWithRed:187.0/255 green:160.0/255 blue:209.0/255 alpha:1.0];
[[progressView layer]setCornerRadius:10.0f];
[[progressView layer]setBorderWidth:2.0f];
[[progressView layer]setMasksToBounds:TRUE];
progressView.clipsToBounds = YES;
[[progressView layer]setFrame:CGRectMake(30, 295, 260, 25)];[[progressView layer]setBorderColor[UIColor whiteColor].CGColor]; 
progressView.trackTintColor = [UIColor clearColor];
[progressView setProgress: (float)count/15 animated:YES];
Above, I have shared the code with you, where first of all I have created an object of UIProgressView named progressView. Then allocated memory for it. Then I have set the various properties of the UIProgressView to make more customized. If you find any problems with the above code feel free to contact me at my mail or mention your issues in the comment below. I will try to get back to you as soon as possible.

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.