首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >更新uipicker

更新uipicker
EN

Stack Overflow用户
提问于 2011-07-19 03:46:48
回答 2查看 164关注 0票数 0

我有两个专栏,在uipicker里。当我从第一列中选择某些内容时,我希望更改另一列中的选项。

源代码有人知道吗?

非常感谢

EN

回答 2

Stack Overflow用户

发布于 2011-12-11 19:01:14

看看Apress的《iPhone4开发》一书,在第7章有一个从属选择器,就是你想做的那个(它被称为从属uipickerview)。

票数 0
EN

Stack Overflow用户

发布于 2011-12-11 19:59:49

试试这样的东西-

代码语言:javascript
复制
- (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];
    }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6738525

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档