更新时间:2022-04-25 01:15:15
这是我在我的一个应用程序中使用的代码:
This is the code I have used in one of my apps:
// Declare the outlet to the picker in your storyboard
@IBOutlet var myPicker: UIPickerView!
//...
override func viewDidLoad() {
//...
myPicker.selectRow(row, inComponent: 0, animated: true)
}
显然,将 row
和 0
替换为您想要的任何值.
Obviously, replace row
and 0
with whatever values you want.
希望这有帮助!