开发者

How could I compare in UIPickerView?

I use UIPickerView with 2 components. The first component is number 0~23. The second one is number 1~24. If I select any number in first component , the second component only show numbers > the number user select in component.

for example:

(If I select number in first component is 20 , so numbers on the second component should be 21.22.23.24)

How could I solve this problem..开发者_如何转开发.

Thanks~


You could restrict the user to select lower value in the second component. If he picks one value in first component in - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
Test if the value in first component is bigger than the value in second component and if yes select an bigger row in second component.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜