質問

I tried to do something like this in the viewDidLoad method:

 self.myStepper.value = 10.0;

But it's not working. I've googled and googled and I can't find any answers to this. It seems so easy for a slider, but can you do it with a stepper as well?

役に立ちましたか?

解決

Stepper values need to be within bounds of min and max, or like in the comments to your question they get pushed to either the min or max. Always check Apple's Reference docs.
Reference: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIStepper_Class/Reference/Reference.html

enter image description here

他のヒント

I figured it out, I simply forgot to init the steppers in the viewDidLoad method. Sorry guys!

We can set the Value for the Stepper using the Below Syntax,

[your_stepper_name setValue:your_stepper_value];

ex:

[stepper setValue:10];

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top