我有在那里我已经不同视图UITextfield
。 为了FIL这个TF我使用的是个性化的UIPickerview
键盘。
我的问题是,当我选择第一个TF键盘开放,我可以选择我的价值。 值到这个选择的TF。 现在,当我选择第二个TF键盘出现,但值进入第一个TF ...
我不知道为什么这不工作...
在我ViewDidLoad
T've有:
flightTimeSe.inputAccessoryView = Ttoolbar
flightTimeSe.delegate = self
flightTimeMe.inputView = DurationPicker
flightTimeMe.inputAccessoryView = Ttoolbar
flightTimeMe.delegate = self
flightTimeMp.inputView = DurationPicker
这种分配UIPickerview
到TF,也是我的工具栏。
我UIPickerview
定义如下:
lazy var DurationPicker: UIPickerView = {
let DurationPicker = UIPickerView()
DurationPicker.delegate = self
DurationPicker.dataSource = self
var flightTime: String = ""
var row0: String = "0"
var row1: String = "0"
var row2: String = "0"
var row4: String = "0"
var row5: String = "0"
row0 = myPickerRow1[DurationPicker.selectedRow(inComponent: 0)]
row1 = myPickerRow2[DurationPicker.selectedRow(inComponent: 1)]
row2 = myPickerRow3[DurationPicker.selectedRow(inComponent: 2)]
row4 = myPickerRow5[DurationPicker.selectedRow(inComponent: 4)]
row5 = myPickerRow6[DurationPicker.selectedRow(inComponent: 5)]
//print("\(row0)\(row1)\(row2):\(row4)\(row5)")
if row0 != "0"{
flightTime = "\(row0)\(row1)\(row2):\(row4)\(row5)"
}else if row0 == "0" && row1 != "0" {
flightTime = "\(row1)\(row2):\(row4)\(row5)"
}else if row1 == "0" && row2 != "0" {
flightTime = "\(row2):\(row4)\(row5)"
}else if row2 == "0" && row4 != "0" {
flightTime = "\(row2):\(row4)\(row5)"
}else if row2 == "0" && row4 == "0" && row5 != "0" {
flightTime = "\(row2):\(row4)\(row5)"
}
print(flightTime)
return DurationPicker
}()
我不知道现在该如何处理我的委托,以填补右TF ...
谢谢你的帮助 !