您可以为UIStepper对象设置默认值/当前值吗? [英] Can you set a default/current value for UIStepper object?

查看:316
本文介绍了您可以为UIStepper对象设置默认值/当前值吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆