无法滚动选择器视图

时间:2017-08-07 05:02:15

标签: ios swift uipickerview pickerview

这是我的选择器视图代码:

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]
}

选择器视图显示在标签下,但是当我尝试从选择器视图中选择一个选项时,没有任何反应。我看到了选项,但无法移动它们。救命!谢谢!

0 个答案:

没有答案