UISlider setMaximumTrackTintColor in iOS 7.1
Found this workaroud:
Create a 1x1px UIImage
from a UIColor
on the fly:
CGRect rect = CGRectMake(0, 0, 1, 1);
UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0);
[color setFill];
UIRectFill(rect);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
and then
[slider setMaximumTrackImage:image forState:UIControlStateNormal];
Looks like an expensive solution but it gets the job done.
UISlider minimum and maximum track tint clear color iOS 7.1 bug
Okay so I solved this already by using these two lines of code replacing the trackTintColor properties altogether:
[self.colorSlider setMinimumTrackImage:[UIImage new] forState:UIControlStateNormal];
[self.colorSlider setMaximumTrackImage:[UIImage new] forState:UIControlStateNormal];
UISlider with single bar color
set
choice -1
yoursliderName.minimumTrackTintColor = [UIColor blueColor];
yoursliderName.maximumTrackTintColor = [UIColor blueColor];
if choice no 1 is not work
choice - 2
see this already answered in stack overflow answer
additional Reference
Unable to set UISlider's track tint to absolute clearColor
You can try this:
UIGraphicsBeginImageContextWithOptions((CGSize){ 1, 1 }, NO, 0.0f);
UIImage *transparentImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[self.seekBar setMinimumTrackImage:transparentImage forState:UIControlStateNormal];
[self.seekBar setMaximumTrackImage:transparentImage forState:UIControlStateNormal];
[self.seekBar setTintColor:[UIColor clearColor]];
Hope it helps :)
Related Topics
Delete Cell from Uicollectionview Without Reloading from Top
How to Resize Uitableviewcell to Fit Its Content
Clipstobounds Causes Uiimage to Not Display in iOS10 & Xcode 8
Calayer - Cabasicanimation Not Scaling Around Center/Anchorpoint
How to Tell If Blocks in Loop All Have Completed Executing
iOS 11+ How to Migrate Existing Core Data to Shared App Group for Use in Extension
How to Play Movie with a Url Using a Custom Nsurlprotocol
Installed App from Testflight Crashes Due to Alleged Uisearchdisplaycontroller
Import Framework in Swift Project, Xcode
Accessing the Settings App from Your App in iOS 8
Cannot Show Automatic Strong Passwords for App Bundleid
Wait for Swift Animation to Complete Before Executing Code
Swift: Equivalent Objective-C Runtime Class
Object-C/iOS :How to Use Asynchronous to Get a Data from Url
Set a Passwordfield to Securetextentry Give Me a Strange Behaviour