码迷,mamicode.com
首页 > 移动开发 > 详细

iOS 日期时间控件

时间:2015-06-05 17:29:36      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:

    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;

 

iOS 日期时间控件

标签:

原文地址:http://www.cnblogs.com/SimonGao/p/4554858.html

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