जब कोई उपयोगकर्ता टेक्स्ट फ़ील्ड पर क्लिक करता है तो मैं पॉपअप के साथ डेटपिकर का उपयोग कर रहा हूं। हालांकि, पिकर पहले महीने प्रदर्शित करता है, पहले दिनांक नहीं है और यह तारीख लिखने का ब्रिटिश तरीका नहीं है। क्या डेटपिकर में डेट प्रारूप को ब्रिटिश तरीके से सेट करने का कोई तरीका है जैसे डीडी/एमएम/वाई वाई? मैं एक Achtionsheet उपयोग कर रहा हूँ:आईफोन: डेटपिकर डीडी/एमएम/yyyy
-(IBAction)acsheet:(id)sender
{
actionSheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:nil
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:nil];
[actionSheet setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
//CGRect pickerFrame = CGRectMake(0, 45, 0, 0);
pickerView1 = [[UIDatePicker alloc] init];
pickerView1.datePickerMode = UIDatePickerModeDate;
[actionSheet addSubview:pickerView1];
UISegmentedControl *closeButton = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObject:@"Close"]];
closeButton.momentary = YES;
closeButton.frame = CGRectMake(260, 7.0f, 50.0f, 30.0f);
closeButton.segmentedControlStyle = UISegmentedControlStyleBar;
closeButton.tintColor = [UIColor blackColor];
[closeButton addTarget:self action:@selector(dismissActionSheet:)
forControlEvents:UIControlEventValueChanged];
[actionSheet addSubview:closeButton];
[actionSheet showInView:[[UIApplication sharedApplication] keyWindow]];
[actionSheet setBounds:CGRectMake(0, 0, 320, 485)];
[pickerView1 addTarget:self
action:@selector(updateLabel:)
forControlEvents:UIControlEventValueChanged];
UIBarButtonItem *spacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismissDatePicker:)] ;
UIToolbar *toolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, self.view.bounds.size.height, 320, 44)];
toolBar.tag = 11;
toolBar.barStyle = UIBarStyleBlackTranslucent;
[toolBar setItems:[NSArray arrayWithObjects:spacer, doneButton, nil]];
[self.view addSubview:toolBar];
}
धन्यवाद, मैं कोशिश करूँगा !!! – user973067
धन्यवाद डेव, लेकिन यह किसी कारण से काम नहीं करता है। इस दुविधा के साथ कोई और? मैंने बीबीओजी का जवाब यहां देखा और यह बहुत निराशाजनक दिखता है: http://stackoverflow.com/questions/9638698/ios-change-language-for-uidatepicker-by-locale – Stavash
यह काम नहीं करता है – sapatos