Reputation: 377
I have created a uislider ..and custmize it.
CGAffineTransform trans = CGAffineTransformMakeRotation(-M_PI*0.5);//for vertical
CGRect frame = CGRectMake(10.0, 100.0, 150.0, 80);
slider = [[UISlider alloc] initWithFrame:frame];
[slider addTarget:self action:@selector(sliderAction:) forControlEvents:UIControlEventValueChanged];
[slider setMinimumTrackTintColor:[UIColor redColor]];//crash on device
slider.transform = trans;
slider.minimumValue = 0.0;
slider.maximumValue = 50.0;
slider.continuous = YES;
slider.value = 25.0;
[self.view addSubview:slider];
The code works fine on simulater.. But on device it crashes at [slider setMinimumTrackTintColor:[UIColor redColor]];. .i am using device ios 4.3.i think custmization of uislider not working on device. Dose anybody have an idea ..plz let me know. Thanks
Upvotes: 0
Views: 493
Reputation: 11970
property MinimumTrackTintColor is only available in iOS 5.0 or later.
Upvotes: 1
Reputation: 37729
[slider setMinimumTrackTintColor:[UIColor redColor]];//crash on device
the method is available in iOS (5.0 and later)
Upvotes: 1