I am having a problem with UISlider programming.
1) style: I know that we need to set the minimum and maximum image. I'm just not sure which images and image links will be great? I want to change only from blue to black!
2), my code for UISlider is this:
in the header file:
UISlider *slider;
in the code file:
CGRect frame=CGRectMake(10, 70, 300, 10);
photoSlider=[[UISlider alloc] initWithFrame:frame];
photoSlider.minimumValue=0.0;
photoSlider.maximumValue=90.0;
photoSlider.continuous=NO;
photoSlider.value=10.0;
photoSlider.backgroundColor=[UIColor clearColor];
[photoSlider addTarget:self action:@selector(updateImage:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:photoSlider];
- (void) updateImage:(id) sender
{
NSLog(@"val: %d",photoSlider.value);
}
The values that I get from the function are 0 at both ends and a very big value between them (both positive and negative ... random values).
Can anybody help me? Thank.
source
share