发送按钮,打开 UIPickerView 到 UIPickerView 的 selectRow 函数
Send button, which opens UIPickerView to UIPickerView's selectRow function
我有两个按钮,打开一个 UIPickerView
@IBOutlet weak var convertFromButton: UIButton!
@IBOutlet weak var convertToButton: UIButton!
我需要选择器的 selectRow
功能来了解 button
用户按下哪个按钮打开它并更改此按钮的标题。所以,我需要这样的功能,但我不知道如何将按钮发送到这个功能。
func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int, button: UIButton) {
button.setTitle(converter.convertTypes[row], forState: UIControlState.Normal)
typePicker.hidden = true;
}
或者每个 button
我需要单独的 picker
吗?
您可以使用附加变量来存储用于打开选择器并在 pickerView:didSelectRow:
中检查其值的最新发件人按钮
我有两个按钮,打开一个 UIPickerView
@IBOutlet weak var convertFromButton: UIButton!
@IBOutlet weak var convertToButton: UIButton!
我需要选择器的 selectRow
功能来了解 button
用户按下哪个按钮打开它并更改此按钮的标题。所以,我需要这样的功能,但我不知道如何将按钮发送到这个功能。
func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int, button: UIButton) {
button.setTitle(converter.convertTypes[row], forState: UIControlState.Normal)
typePicker.hidden = true;
}
或者每个 button
我需要单独的 picker
吗?
您可以使用附加变量来存储用于打开选择器并在 pickerView:didSelectRow: