如何使用从UIPicker视图中选择的值填充UITextView。因此,用户从UIPickerView中选择一个类别,该值显示在UITextView上。
答案 0 :(得分:0)
请使用以下代码:
- (void)pickerView:(UIPickerView *)thepickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
switch (thepickerView.tag) {
case PICKER_TYPE_A:{
txtField.text = [arrayA objectAtIndex:row];
}
break;
case PICKER_TYPE_B:{
txtField.text = [arrayB objectAtIndex:row];
}
break;
default:
break;
}
}
答案 1 :(得分:0)
您需要实现UIPickerView
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
// Write your code here
// yourTextField.text = [yourArray objectAtIndex:row];
}