intervalList=[[NSArray alloc] initWithObjects:@"2 Hours",@"4 Hours",@"8 Hours", nil];
intervalPicker = [[UIPickerView alloc]init];
[intervalPicker setFrame:CGRectMake(0, self.view.frame.size.height-162, self.view.frame.size.width, 162)];
intervalPicker.delegate = self;
intervalPicker.dataSource=self;
[self.intervalTextField setInputView:intervalPicker];
intervalPicker.backgroundColor = [UIColor whiteColor];
UIToolbar *toolbar1 = [[UIToolbar alloc] initWithFrame: CGRectMake(0, 0, self.view.frame.size.width, 44)];
toolbar1.barStyle = UIBarStyleBlackOpaque;
toolbar1.autoresizingMask = UIViewAutoresizingFlexibleWidth;
toolbar1.backgroundColor=[UIColor colorWithRed:(63.0f/255.0f) green:(81.0f/255.0f) blue:(181.0f/255.0f) alpha:1];
UIBarButtonItem *doneButton1 = [[UIBarButtonItem alloc] initWithTitle: @"Done" style: UIBarButtonItemStyleDone target: self action: @selector(intervalShow)];
[doneButton1 setTintColor:[UIColor whiteColor]];
UIBarButtonItem* flexibleSpace1= [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
UIBarButtonItem *cancelButton1 = [[UIBarButtonItem alloc] initWithTitle: @"Cancel" style: UIBarButtonItemStyleDone target: self action: @selector(showcancelbtnclicked)];
[cancelButton1 setTintColor:[UIColor whiteColor]];
toolbar1.items = [NSArray arrayWithObjects:doneButton1,flexibleSpace1,cancelButton1, nil];
[self.intervalTextField setInputAccessoryView:toolbar1];
self.intervalTextField.inputView = intervalPicker;
-(void)intervalShow{
self.intervalTextField.text =intervalString;
[self.intervalTextField resignFirstResponder];
}
-(void)showcancelbtnclicked
{
//datepicker.hidden=YES;
[self.intervalTextField resignFirstResponder];
}
intervalPicker = [[UIPickerView alloc]init];
[intervalPicker setFrame:CGRectMake(0, self.view.frame.size.height-162, self.view.frame.size.width, 162)];
intervalPicker.delegate = self;
intervalPicker.dataSource=self;
[self.intervalTextField setInputView:intervalPicker];
intervalPicker.backgroundColor = [UIColor whiteColor];
UIToolbar *toolbar1 = [[UIToolbar alloc] initWithFrame: CGRectMake(0, 0, self.view.frame.size.width, 44)];
toolbar1.barStyle = UIBarStyleBlackOpaque;
toolbar1.autoresizingMask = UIViewAutoresizingFlexibleWidth;
toolbar1.backgroundColor=[UIColor colorWithRed:(63.0f/255.0f) green:(81.0f/255.0f) blue:(181.0f/255.0f) alpha:1];
UIBarButtonItem *doneButton1 = [[UIBarButtonItem alloc] initWithTitle: @"Done" style: UIBarButtonItemStyleDone target: self action: @selector(intervalShow)];
[doneButton1 setTintColor:[UIColor whiteColor]];
UIBarButtonItem* flexibleSpace1= [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
UIBarButtonItem *cancelButton1 = [[UIBarButtonItem alloc] initWithTitle: @"Cancel" style: UIBarButtonItemStyleDone target: self action: @selector(showcancelbtnclicked)];
[cancelButton1 setTintColor:[UIColor whiteColor]];
toolbar1.items = [NSArray arrayWithObjects:doneButton1,flexibleSpace1,cancelButton1, nil];
[self.intervalTextField setInputAccessoryView:toolbar1];
self.intervalTextField.inputView = intervalPicker;
-(void)intervalShow{
self.intervalTextField.text =intervalString;
[self.intervalTextField resignFirstResponder];
}
-(void)showcancelbtnclicked
{
//datepicker.hidden=YES;
[self.intervalTextField resignFirstResponder];
}
Sign up here with your email
ConversionConversion EmoticonEmoticon