dropdown_1.frame = CGRectMake(...); dropdown_2.frame = CGRectMake(...);
> arraySizes5 = [sverysmall, ssmall, snormal, slarge, sverylarge]; > arraySizes3 = [ ssmall, snormal, slarge];
func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int {
return 1
}
func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return arraySizes5.count; <<----- How to differentiate ??
}
func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String! {
return arraySizes5[row]
}
如何在函数pickerView中的2个下拉列表中添加相应的值?或者,如果有帮助,我该如何设置组件ID?
答案 0 :(得分:2)
以下是您可以这样做的方式:
layout