Reputation: 211
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.
Upvotes: 0
Views: 2080
Reputation: 375
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]]];
}
Upvotes: 0
Reputation: 211
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.
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 ;-)
Upvotes: 3