我有两个专栏,在uipicker里。当我从第一列中选择某些内容时,我希望更改另一列中的选项。
源代码有人知道吗?
非常感谢
发布于 2011-12-11 19:01:14
看看Apress的《iPhone4开发》一书,在第7章有一个从属选择器,就是你想做的那个(它被称为从属uipickerview)。
发布于 2011-12-11 19:59:49
试试这样的东西-
- (void)pickerView:(UIPickerView *)pickerView
didSelectRow:(NSInteger)row
inComponent:(NSInteger)component {
if (component == 0) {
//Here First Part of the Pickerview is represented using 0.
// dependentPicker is the Pickerview outlet
[dependentPicker selectRow:row inComponent:1 animated:YES];
[dependentPicker reloadComponent:1];
}
else
{
[dependentPicker selectRow:row inComponent:0 animated:YES];
[dependentPicker reloadComponent:1];
}
}https://stackoverflow.com/questions/6738525
复制相似问题