码迷,mamicode.com
首页 > 其他好文 > 详细

UIPickerView 修改必须滚动才修改值的bug

时间:2015-12-04 18:09:29      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:

//相应的选择转动
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
    if (component == 1) {
        hour_start = [hour_array[row] integerValue];
        NSInteger row = [pickerView selectedRowInComponent:2];
        minute_start = [minute_array[row] integerValue];
    } else if (component == 2) {
        minute_start = [minute_array[row] integerValue];
        NSInteger row = [pickerView selectedRowInComponent:1];
        hour_start = [hour_array[row] integerValue];
    }
    if (selectRow == 0) {
        startTime[0] = [NSString stringWithFormat:@"%02d:%02d", hour_start, minute_start];
    } else if (selectRow == 1) {
        startTime[1] = [NSString stringWithFormat:@"%02d:%02d", hour_start, minute_start];
    } else {
        startTime[2] = [NSString stringWithFormat:@"%02d:%02d", hour_start, minute_start];
    }
}

UIPickerView 修改必须滚动才修改值的bug

标签:

原文地址:http://www.cnblogs.com/tian-sun/p/5019859.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!