iOS 日期时间控件

    UIDatePicker *picker        =   [[UIDatePicker alloc]initWithFrame:CGRectMake(0, 0,[UIParam widthScreen] ,50 )];
    
    picker.minimumDate          =   [NSDate date];
    picker.maximumDate          =   nil;
    picker.backgroundColor      =   [UIColor whiteColor];
    picker.layer.borderColor    =   [kUIColor(238, 238,238) CGColor];
    picker.layer.borderWidth    =   1;
    [picker addTarget:self action:@selector(dateChange:) forControlEvents:UIControlEventValueChanged];
    NSLocale *locale            =   [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"];
    
    picker.locale               =   locale;
    
    //设置日期的显示格式
    picker.datePickerMode       =   UIDatePickerModeDateAndTime;

 

posted on 2015-06-05 16:00  大木哥  阅读(1165)  评论(0编辑  收藏  举报

导航