uidatepicker

How in iOS to localize text of the month in UIDatePicker, and if it is possible at all?

故事扮演 提交于 2020-01-02 02:20:08
问题 I make search and up to now I see that UIDatePicker is working with localization of the device. I have app which has internal lozalization. I need to change month's text dependantly of my internal localization. As I read it appears that this is not possible - I have to make my own custom picker. Is there a way to achieve that without custom Dat picker? 回答1: Use locale property of UIDatePicker. I can't see any signs that the property is deprecated. This code will localize picker to Japanese.

How to change the line color of a UIDatePicker

梦想的初衷 提交于 2020-01-01 09:55:33
问题 I have got a UIDatePicker in one of my ViewControllers. As you can see, the background is dark. What i already managed to change is the text color to white. What i just can't change is the color of the two lines above and below the selected date. It always remains default dark grey. Does anyone have a code snipped to achieve coloring these lines? 回答1: To start with, Apple docs says, about Date Pickers , "You cannot customize the appearance of date pickers." That being said, the following code

How to change the line color of a UIDatePicker

杀马特。学长 韩版系。学妹 提交于 2020-01-01 09:55:14
问题 I have got a UIDatePicker in one of my ViewControllers. As you can see, the background is dark. What i already managed to change is the text color to white. What i just can't change is the color of the two lines above and below the selected date. It always remains default dark grey. Does anyone have a code snipped to achieve coloring these lines? 回答1: To start with, Apple docs says, about Date Pickers , "You cannot customize the appearance of date pickers." That being said, the following code

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

UIDatePicker return wrong NSDate

不想你离开。 提交于 2019-12-30 09:50:10
问题 I am using UIDatePicker in my app and when i take the date that was chosen with: NSDate *date = picker.date; picker.date returned the day before the date that I chose. any idea why it happens? 回答1: UIDatePicker will be displaying dates and times in your local timezone. However, NSDate does not have any concept of a timezone as it stores an absolute number of seconds since a reference date. When NSLogging a date, it shows the date and time in GMT. I expect if you work out your local timezone

Datepicker dynamic min / max dates

依然范特西╮ 提交于 2019-12-30 07:33:53
问题 I'm using the jQuery datepicker plugin on a site I am building. I need users to be able to pick two dates from within a specified range of dates. This is straightforward enough to do. The problem is that the allowable range of dates changes depending on another select box (with building names in). So what I need to happen is to look up the building in a mysql database, return the min and max date allowed and use the datepicker to allow users to choose a date range within the allowable range.

Datepicker dynamic min / max dates

流过昼夜 提交于 2019-12-30 07:32:07
问题 I'm using the jQuery datepicker plugin on a site I am building. I need users to be able to pick two dates from within a specified range of dates. This is straightforward enough to do. The problem is that the allowable range of dates changes depending on another select box (with building names in). So what I need to happen is to look up the building in a mysql database, return the min and max date allowed and use the datepicker to allow users to choose a date range within the allowable range.

How can I show a UIDatePicker inside a Popover on iPad using StoryBoard?

杀马特。学长 韩版系。学妹 提交于 2019-12-30 03:26:07
问题 I have achieved to show the datepicker inside the popover, doing it programmatically as it is shown in UIDatePicker in UIPopover. But I have been trying to do it in interface Builder, I already made a View Controller named DatePickerViewController.m with a DatePicker in it and its corresponding IBoulet #import <UIKit/UIKit.h> @interface DatePickerViewController : UIViewController @property (strong, nonatomic) IBOutlet UIDatePicker *birthdayDatePicker; @end Then I need this to be shown in a

Converting String to NSDate Giving Wrong Date

白昼怎懂夜的黑 提交于 2019-12-29 02:06:32
问题 I have a String that I converted using stringFromDate and now I'm trying to convert it back, however when the UIPicker starts, it's giving me the wrong day let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "dd MMM YYYY" print(birthday) // logs 15 Jan 1992 let date = dateFormatter.dateFromString(birthday) self.datePicker.setDate(date!, animated: true) I tried hardcoding "15 Feb 1992" but still the same result. The date on UIDatePicker shows 22 Dec 1991 on Start. If I use

Set text color and font for UIDatePicker in iOS8/Swift

江枫思渺然 提交于 2019-12-28 04:22:06
问题 I've been having trouble trying to set the UIDatePicker font and color . Everything else in my app was fairly straightforward to adjust except this. Does anybody know how to do this? I'm using Swift for iOS8 . 回答1: Changing the date mode to something else seems to force a re-draw with the newly set text color. datePicker.setValue(UIColor.whiteColor(), forKeyPath: "textColor") datePicker.datePickerMode = .CountDownTimer datePicker.datePickerMode = .DateAndTime //or whatever your original mode