iphone - setting a default value for slider when app loads -


in iphone app i'm using slider adjusting volume , working fine. i'm not able set default value slider when app loads. have seen when slider touched value gets changed.but need default value when app loads. code given below

- (ibaction)sliderchanged:(id)sender {      slider = (uislider *) sender;     slider.minimumvalue = 0.5;     slider.maximumvalue = 2.2;     progressasint = slider.value ; } 

how can solve issue.

please help.thanks in advance.

there 2 ways change default value of slider.

  1. using interface builder. see attached picture , value of current property. enter image description here

  2. using code

you need write 1 line in viewwillappear delegate method.

-(void)viewwillappear:(bool)animated{    slider.value = 1.0;  } 

hope help.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -