ios - Why I'm unable to decrease the brightness using a UISlider? -


in app, i'm using uislider reduce/improve brightness of uiimage. slider's min value=0 , max value=1.slider's current value 1; when move slider 1 0.7 uiimage getting bright when move 0.7 1, uiimage isn't reducing brightness; here code uislider's action:

-(ibaction)sliderbright:(uislider*)sender {     float alphavalue;     value2 = sender.value;     if (value1>=value2) {//i fixed value1=1.0 in viewdidload();         nslog(@"the value of slider , alpha %f,", value2);         alphavalue= value2;         value2=value1;     }     else{         alphavalue= value2+0.2;         value2=value1;     }     _displayimage.alpha=alphavalue;  } 

how can fix it?alpha value uiimage control whiteness, there way control blackness of uiimage?

just set uislider's value uiimage's alpha in method.

_displayimage.alpha = sender.value; 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -