Created
September 19, 2014 04:29
-
-
Save keslert/be4240995d136091d7ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_pickerViewDate = [UIAlertController alertControllerWithTitle:@"" message:@"" preferredStyle:UIAlertControllerStyleActionSheet]; | |
_theDatePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0.0, 44.0, 0,0)]; | |
_theDatePicker.datePickerMode = UIDatePickerModeDate; | |
// [_theDatePicker setBackgroundColor:[UIColor whiteColor]]; | |
_pickerToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 144)]; | |
_pickerToolbar.barStyle=UIBarStyleBlackOpaque; | |
[_pickerToolbar setBackgroundImage:[UIImage imageWithColor:[[ADVThemeManager sharedTheme] getColor:@"primary"] width:1 height:1] forToolbarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault]; | |
[_pickerToolbar sizeToFit]; | |
NSMutableArray *barItems = [[NSMutableArray alloc] init]; | |
UIBarButtonItem *cancelBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(DatePickerDoneClick:)]; | |
cancelBtn.tag = 101; | |
UIBarButtonItem *uncheckBtn = [[UIBarButtonItem alloc] initWithTitle:@"Uncheck" style:UIBarButtonItemStyleBordered target:self action:@selector(DatePickerDoneClick:)]; | |
uncheckBtn.tag = 102; | |
UIBarButtonItem *flexibleSpaceLeft = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; | |
UIBarButtonItem *doneBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(DatePickerDoneClick:)]; | |
doneBtn.tag = 103; | |
[barItems addObject:cancelBtn]; | |
[barItems addObject:uncheckBtn]; | |
[barItems addObject:flexibleSpaceLeft]; | |
[barItems addObject:doneBtn]; | |
[_pickerToolbar setItems:barItems animated:YES]; | |
[_pickerViewDate.view addSubview:_pickerToolbar]; | |
[_pickerViewDate.view addSubview:_theDatePicker]; | |
[_pickerViewDate.view setBackgroundColor:[UIColor redColor]]; | |
// [_pickerViewDate.view setFrame:CGRectMake(-10, -40, self.view.frame.size.width, 10)]; | |
[_pickerViewDate.view setBounds:CGRectMake(7, 200, self.view.frame.size.width, 200)]; | |
[self presentViewController:_pickerViewDate animated:YES completion:nil]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment