uidatepicker

Objective C: UIDatePicker UIControlEventValueChanged only fired on second selection

拈花ヽ惹草 提交于 2019-11-27 14:28:06
问题 Working with UIDatePickers for the first time. To start, I'm just trying to update a text field with whatever value is selected from the datePicker (set in count down mode). It works, but only the second time that a user selects a time. My action, durationSelected() is only called the second time, so there are no problems updating the textField. Here's how I configured the date picker in my storyboard: Here's the action triggered on Value Changed: from DetailViewController.m - (IBAction

How do I rewrite the UIDatePicker component?

余生颓废 提交于 2019-11-27 12:24:09
问题 I've noticed that the UIDatePicker doesn't work with NSHebrewCalendar in iOS 5.0 or 5.1. I've decided to try and write my own. I'm confused as to how to populate the data and how to maintain the labels for the dates in a sane and memory efficient manner. How many rows are there actually in each component? When do the rows get "reloaded" with new labels? I'm going to give this a shot, and I'll post as I find out, but please post if you know anything. 回答1: First off, thanks for filing the bug

UIDatePicker, setting maximum and minimum dates based on todays date

為{幸葍}努か 提交于 2019-11-27 11:54:10
If I have a UIDatePicker, and I wish to set the minimum and maximum date range to be between thirty years ago and thirty years in the future, how would I set that up? Not tested, but you probably want something like this. NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDate *currentDate = [NSDate date]; NSDateComponents *comps = [[NSDateComponents alloc] init]; [comps setYear:30]; NSDate *maxDate = [calendar dateByAddingComponents:comps toDate:currentDate options:0]; [comps setYear:-30]; NSDate *minDate = [calendar dateByAddingComponents:comps

Change UIDatePicker font color?

谁说我不能喝 提交于 2019-11-27 11:47:43
All I want to do is change the font color of the UIDatePicker. I've researched other questions but they're all involving changing other properties and customizing the entire look. All I want to do is just change the font color from black to white. I find it hard to believe that I can't do such a seemingly simple task. And why wouldn't the tint color affect it? Does it even do anything? waffles All I need (on iOS 8.x and 9.0) is this one line to change the font color: [my_date_picker setValue:[UIColor whiteColor] forKey:@"textColor"]; No subclassing or invoking of private APIs... Note: today's

UIDatePicker in UIActionSheet on iPad

a 夏天 提交于 2019-11-27 11:42:45
问题 In the iPhone version of my app, I have a UIDatePicker in a UIActionSheet . It appears correctly. I am now setting up the iPad version of the app, and the same UIActionSheet when viewed on the iPad appears as a blank blank box. Here is the code I am using: UIDatePicker *datePickerView = [[UIDatePicker alloc] init]; datePickerView.datePickerMode = UIDatePickerModeDate; self.dateActionSheet = [[UIActionSheet alloc] initWithTitle:@"Choose a Follow-up Date" delegate:self cancelButtonTitle:nil

Show datepicker on textfield tap

孤街醉人 提交于 2019-11-27 10:54:08
问题 I'm very new to iOS so obviously I'm missing a few concepts when trying to follow this solution Display datepicker on tapping on textfield to my problem. I have the interface and implementation in a class called DatepickerAppDelegate, but I'm lost here: "In the XIB, Pull out a UIToolbar and a UIDatePicker but don't attach it to the view. Connect the outlets appropriately. dateChanged: responds to changes in the date picker and doneEditing: is called when the Done button in the tool bar is

Customize text color of UIDatePicker for iOS7 (just like Mailbox does)

荒凉一梦 提交于 2019-11-27 09:41:12
问题 I'm having the most frustrating dilemma. I've researched up and down and can clearly see that Apple does not want us tampering with iOS 7. Well, I want to tamper. And, the team at Mailbox clearly figured out how to do it and get approved. The main thing that I'm trying to achieve is to change the label color to white. My first thought was they are using a custom UIPickerView that just mimics a UIDatePicker, but I just don't think this is the case. I zoomed in on a small fragment and

Elegantly replace iPhone keyboard with UIPickerView

不打扰是莪最后的温柔 提交于 2019-11-27 09:34:07
问题 I have a table view that has embedded UITextFields for entering some data. It also has two other fields that popup a UIPickerView and a UIDatePicker - as demonstrated in the DateCell example from Apple. Mostly it works but I can't figure out how to cleanly transition from the text field keyboard to the other pickers - one slides out, one slides in - it looks weird and the scroll position on the table view sometimes gets screwed up - with everything scrolled off the top. What I'd like to do is

UIDatePicker show only month and day

江枫思渺然 提交于 2019-11-27 09:05:59
I'd like to have a UIDatePicker where the user can pick a month and a day but not the year. I'm aware that leap years have an extra day, so for simplicity, let's throw that day away. Is there any way to remove the year column or have 2 reels with month/day that act like the UIDatePicker (grey out days that don't exist in the selected month)? adam You cannot use the UIDatePicker class as it stands to do this - The UIDatePicker only supports the following modes typedef enum { UIDatePickerModeTime, UIDatePickerModeDate, UIDatePickerModeDateAndTime, UIDatePickerModeCountDownTimer }

iOS 7 UIDatePicker in UIAlertView customisation

你。 提交于 2019-11-27 08:12:50
问题 Guys I was adding UIDatePicker to UIAlertView like this It was fine with iOS 6 and below now in iOS 7 it comes like this Any ideas why this happens? Is there a better way of doing this?.Any help is appreciated. 回答1: This is my component to support addSubview in AlertView. CXAlertView - Custom alert-view which allow you to add view as main content. 回答2: You can change accessoryView to any own customContentView in a standard alert view in iOS7 [alertView setValue:customContentView forKey:@