这是我的选择器视图代码:
func numberOfComponents(in pickerView: UIPickerView) -> Int {
return 1
}
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
return teams[row]
}
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return teams.count
}
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
HomeName.text = teams[row]
}
选择器视图显示在标签下,但是当我尝试从选择器视图中选择一个选项时,没有任何反应。我看到了选项,但无法移动它们。帮助!谢谢!