Uidatepicker *picker = [[Uidatepicker alloc] init];
Picker.datepickermode = uidatepickermodedate;
Picker.locale = [[Nslocale alloc] initwithlocaleidentifier:@ "ZH_CN"];
setting up the keyboard
Self . MyField. Inputview = picker;
//Set the toolbar above the keyboard
self. MyField. Inputaccessoryview = [UIButton buttonwithtype: Uibuttontypecontactadd];
Set the toolbar on the keyboard
uibarbuttonitem *prevbuttonitem = [[Uibarbuttonitem Alloc Initwithtitle:@ " previous " style:uibarbuttonitemstylebordered target:self< Span class= "S1" >action: @selector (showprevious)];
uibarbuttonitem *nextbuttonitem = [[ Uibarbuttonitem alloc] initwithtitle:@ " next " style:uibarbuttonitemstylebordered target:selfaction: @selector
uibarbuttonitem *hiddenbuttonitem = [[ Uibarbuttonitem alloc] initwithtitle:@ " Hide keyboard " style:uibarbuttonitemstylebordered target:selfaction: @selector
uibarbuttonitem *spacebuttonitem = [[ Uibarbuttonitem alloc]initwithbarbuttonsystemitem: Uibarbuttonsystemitemflexiblespace target:nil action:nil];
Uitoolbar *accessoryview = [[Uitoolbar alloc] initwithframe: CGRectMake(0, 0, self. View. Frame. Size. Width, .)];
Accessoryview.barstyle = uibarstyleblacktranslucent;
Accessoryview. items = [nsarray Arraywithobjects:prevbuttonitem,nextbuttonitem,spacebuttonitem,hiddenbuttonitem, Nil];
Self. MyField. Inputaccessoryview = Accessoryview;
Use of Ios-datepicker