Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to display only time in UIDatePicker iphone

Tags:

In my app i am displaying a UIDateTimePicker in action sheet through code. it is working fine. But i don't want to display date and day.How this can be done. Please help. Thanks in advance.

code:

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"Select     Date",@"Selecte Date")delegate:self cancelButtonTitle:NSLocalizedString(@"Done",@"Done") destructiveButtonTitle:NSLocalizedString(@"Cancel",@"Cancel") otherButtonTitles:nil];         actionSheet.actionSheetStyle = UIActionSheetStyleBlackTranslucent;   UIDatePicker  *datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, 50, 320, 270)];     //datePicker.showsSelectionIndicator = YES; //   datePicker.dataSource = self; //datePicker.delegate = self;     [actionSheet addSubview:datePicker];     [datePicker release];      [actionSheet showInView:self.view];     [actionSheet setBounds:CGRectMake(0, 0, 320, 500)];   [actionSheet release]; 
like image 728
ishhhh Avatar asked Jul 21 '11 09:07

ishhhh


1 Answers

datePicker.datePickerMode = UIDatePickerModeTime; 
like image 119
Vaishnavi Naidu Avatar answered Sep 26 '22 04:09

Vaishnavi Naidu