您可以为UIStepper对象设置默认值/当前值吗? [英] Can you set a default/current value for UIStepper object?
问题描述
我试图在viewDidLoad方法中执行以下操作:
I tried to do something like this in the viewDidLoad method:
self.myStepper.value = 10.0;
但是它不起作用.我已经在Google和Google上搜索了,但找不到任何答案.滑块似乎很容易,但是您也可以使用步进器吗?
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?
推荐答案
步进值必须在min和max的范围内,或者像在您的问题注释中一样,它们被推到min或max.始终检查Apple的参考文档.
参考: http://developer.apple. com/library/ios/#documentation/UIKit/Reference/UIStepper_Class/Reference/Reference.html
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
这篇关于您可以为UIStepper对象设置默认值/当前值吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!