First off I want to say I saw a couple of posts on this site about how to do this, although none seemed to work for me so please don't close this down until I get it working.
What I want to do is make the background of the view change depending on the value of the sliders are, so that the user can choose the background colour they want.
self->colorView.backgroundColor = [UIColor myColor];
myColor =
I figure I'll need a bit of code like that, although I don't know how to define what my colour will be something; like "red: redSlider / 255" and so on for the other colours? I also don't know where to implement the code above as I need it to continuously update when the use changes the values of the sliders.
I am quite basic at programming as you may have picked up because I'm only a teenager doing it as a hobby and I'd appreciate simple instructions telling me clearly where I need to put code etc.
p.s. It won't let me post an image of the view, sorry :(
As UISlider implements the UIAppearence protocol you can set its background color like:
or:
In your ViewController.h file define
In ViewController.m file, add this:
In Interface Builder, Drag UISlider to view and set its "Value Changed" event outlet to
sliderValueChanged
method.Now as you change the slider on screen, the color should changed based on your logic in the method
sliderValueChanged
Below is the logic as per your requirement: