uidatepickermodetime

blank UIDatePicker on iPad in mode UIDatePickerModeDateAndTime

怎甘沉沦 提交于 2019-12-31 02:51:11
问题 I am struggling with the UIDatePicker on iPad. The setDate or .date assignment makes the DatePicker empty: UIDatePicker * dtVCpicker = [[UIDatePicker alloc] initWithFrame:CGRectZero]; dtVCpicker.datePickerMode = UIDatePickerModeDateAndTime; dtVCpicker.date = [NSDate date]; dtVCpicker.minimumDate = [NSDate date]; [self.view.window addSubview:dtVCpicker]; if I change the mode to UIDatePickerModeDate or UIDatePickerModeTime then it would look normal. Thanks a lot for your answers! 回答1: I

iOS9: UIDatePicker with datePickerMode of UIDatePickerModeTime only shows Hours, and no Minutes

旧巷老猫 提交于 2019-12-21 04:01:30
问题 I'm using Xcode beta 7 with the iOS9 simulator. Using a UIDatePicker with a datePickerMode of UIDatePickerModeTime only shows Hours, and not minutes. See screenshot: On iOS 7 and 8, obviously it works as expected, and shows both Hours and Minutes. Screenshot: I really do not want to reinvent the wheel and roll my own time picker. Any ideas on why this might be happening and how to fix? I can't find anything on google. thanks, Alex 回答1: Found a useful description of this problem in the iOS 9

UIDatePicker customization

自闭症网瘾萝莉.ら 提交于 2019-12-12 11:23:22
问题 I have customized UIDatePicker to a level and I am adding it to UIAlertView. but I am getting a black color on the bottom and the top of date picker, how to remove it. I want the date picker to be neat and clean. The code I use to achieve this: UIDatePicker *datePicker = [[UIDatePicker alloc] init]; datePicker.frame=CGRectMake(20, 45.0, 240.0, 150.0); datePicker.minimumDate=[NSDate date]; //Forget about this logic. NSString *alertTitleString=@""; if(self.presentingViewController !=nil) {

UIDatePicker not rendering properly for certain modes in UIPopoverController

こ雲淡風輕ζ 提交于 2019-12-11 04:58:29
问题 I have a UIDatePicker using UIDatePickerModeTime that I use in an iPhone app modally, works fine: Using this same basic code for iPad, but putting the view in a UIPopoverController gives some pretty inconsistent results. My desired mode ( UIDatePickerModeTime ) plus the other three modes are shown below. Notice how 2 of them are not rendering at all, but instead have no content UIDatePickerModeTime UIDatePickerModeCountDownTimer UIDatePickerModeDateAndTime UIDatePickerModeDate What could be

iOS9: UIDatePicker with datePickerMode of UIDatePickerModeTime only shows Hours, and no Minutes

限于喜欢 提交于 2019-12-03 12:05:22
I'm using Xcode beta 7 with the iOS9 simulator. Using a UIDatePicker with a datePickerMode of UIDatePickerModeTime only shows Hours, and not minutes. See screenshot: On iOS 7 and 8, obviously it works as expected, and shows both Hours and Minutes. Screenshot: I really do not want to reinvent the wheel and roll my own time picker. Any ideas on why this might be happening and how to fix? I can't find anything on google. thanks, Alex Found a useful description of this problem in the iOS 9 release notes - seems I should be reading these more carefully. UIPickerView and UIDatePicker are now

blank UIDatePicker on iPad in mode UIDatePickerModeDateAndTime

五迷三道 提交于 2019-12-02 02:08:52
I am struggling with the UIDatePicker on iPad. The setDate or .date assignment makes the DatePicker empty: UIDatePicker * dtVCpicker = [[UIDatePicker alloc] initWithFrame:CGRectZero]; dtVCpicker.datePickerMode = UIDatePickerModeDateAndTime; dtVCpicker.date = [NSDate date]; dtVCpicker.minimumDate = [NSDate date]; [self.view.window addSubview:dtVCpicker]; if I change the mode to UIDatePickerModeDate or UIDatePickerModeTime then it would look normal. Thanks a lot for your answers! I implemented the work-around for this issue: setting the dtVCpicker.date inside the viewDidLoad made the Picker

How to disable only date selection in UIDatePicker not time selection

夙愿已清 提交于 2019-12-01 05:01:29
问题 I am using UIDatePicker in my app and I want to disable only date selection in it and time selection should not be effected. Can anyone help me with this. 回答1: Set the datePickerMode to UIDatePickerModeTime . 回答2: Please try this: datePicker.datePickerMode = UIDatePickerModeTime; Other options are: typedef enum { UIDatePickerModeTime, UIDatePickerModeDate, UIDatePickerModeDateAndTime, UIDatePickerModeCountDownTimer } UIDatePickerMode; 回答3: This will do the job datePicker.datePickerMode =