sta*_*rob 4 iphone uipickerview
有没有办法为UIPicker设置默认位置?我的意思是,如果用户可以选择在UIPicker中选择1到100之间的任何数字,我可以将其设置为自动从50开始吗?
你可以selectRow:inComponent:animated:像这样使用:
[somePickerView selectRow:49 inComponent:0 animated:NO]; // Zero-indexed, so row 49 is the row that says 50
Run Code Online (Sandbox Code Playgroud)
您可以viewDidLoad在UIViewController管理包含该视图的视图的方法中触发它UIPickerView.
(也可能是你可以在Interface Builder中指定默认值,但我不确定,我没有检查......)
| 归档时间: |
|
| 查看次数: |
2771 次 |
| 最近记录: |