0

I have an app using progress views with custom images. I use the code below:

[cell.proStatus setTrackImage: [[UIImage imageNamed:@"CircleGrey.png"] resizableImageWithCapInsets:UIEdgeInsetsZero]];
[cell.proStatus setProgressImage: [[UIImage imageNamed:@"CirclePurple.png"] resizableImageWithCapInsets:UIEdgeInsetsZero]];

It all works fine in iOS 6 and 7.0 - BUT when updating to iOS 7.1 it doesn't show the images - just the small little thin line (the standard progress view). What do I do?

I have searched and read here in stack overflow of course. And i have found the following:

UIProgressView custom track and progress images in iOS 7.1

But I can't get it to work? I'm a little new to this programming. Can someone please tell me (simple and basics) what i have to do to get it to work? In the thread I linked to the answer is to implement a JEProgressView from github. Maybe I'm just too much a beginner to completely understand how to do that. I have googled and tried, but it just won't work.

Community
  • 1
  • 1
Glenn Sønderskov
  • 211
  • 1
  • 2
  • 9
  • This is not hard to understand. It's a bug! Apple has broken this feature. http://stackoverflow.com/a/22314075/341994 You can't "get it to work". That is what a bug is about. – matt Mar 20 '14 at 17:20
  • My solution is just to draw my own view that _looks_ sort of like a progress view. – matt Mar 20 '14 at 17:21
  • Okay. Thanks for the quick answer! But what about the JEProgressView workaround. How do you implement that? – Glenn Sønderskov Mar 20 '14 at 19:05
  • 1
    I don't. I roll my own. – matt Mar 20 '14 at 19:42
  • Okay. Thanks, I think.. But if you have an idea or guide how to do it, or your own workaround, I would like to hear it. I'm kind of stuck right now.. But thanks for your answers :-) – Glenn Sønderskov Mar 20 '14 at 22:27
  • See the update to the linked question. You have to set the tint color of the progress bar to clear for the progress image to work with the JEProgressView fix. – Tom Hamming Mar 21 '14 at 15:21

2 Answers2

3

Okay I have worked it out. I know it must be very basic Xcode stuff - but if there is others who have the same issue as I had, here is what I did.

  • Download the JEProgressView files from github. (https://gist.github.com/JohnEstropia/9482567)
  • Import them into the project.
  • In the storyboard (if you use that) select the current ProgressView, and in the right side of the screen under 'Identity inspector', in the field 'Class' enter : "JEProgressView"

Maybe it is placed a little different on the screen, and you have to adjust a little afterwards in the x and y frame settings. But after these steps it should work!

Pretty simple, but for a beginner like me it took some time to figure out :-P Hopefully this can save some time for other beginners ;-)

Glenn Sønderskov
  • 211
  • 1
  • 2
  • 9
0

Try this for iOS version 7.1 and above in customizing progress image:

if ([[UIDevice currentDevice] systemVersion] >= 7)
{
    [cell.proStatus setTrackTintColor: [UIColor colorWithPatternImage: [[UIImage imageNamed:@"CircleGrey.png"]     resizableImageWithCapInsets:UIEdgeInsetsZero]]];
    [cell.proStatus setProgressTintColor: [UIColor colorWithPatternImage: [[UIImage imageNamed:@"CirclePurple.png"] resizableImageWithCapInsets:UIEdgeInsetsZero]]];
}
Aanabidden
  • 375
  • 6
  • 18