- (UIView *)returnCustomePickerView:(UIViewController *)viewController {
UIView *pickerBackView = [[[UIView alloc] initWithFrame:CGRectMake(0, 200, 320, 260)] autorelease];
UIToolbar *toolBar = [[[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)] autorelease];
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Done"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(updateData)];
UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithTitle:@"Cancel"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(logoutData)];
UIBarButtonItem *flexible = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:self
action:nil];
UIBarButtonItem *clearButton = [[UIBarButtonItem alloc] initWithTitle:@"Clear"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(clearData)];
[toolBar setItems:[NSArray arrayWithObjects:cancelButton, clearButton, flexible, doneButton, nil]];
UIPickerView *pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0.0f, 44.0f, 320.0f, 216.0f)];
pickerView.showsSelectionIndicator = YES;
[pickerBackView addSubview:pickerView];
[pickerBackView addSubview:toolBar];
[pickerView release];
[doneButton release];
[cancelButton release];
[clearButton release];
[flexible release];
return pickerBackView;
}
UIView *pickerBackView = [[[UIView alloc] initWithFrame:CGRectMake(0, 200, 320, 260)] autorelease];
UIToolbar *toolBar = [[[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)] autorelease];
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Done"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(updateData)];
UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithTitle:@"Cancel"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(logoutData)];
UIBarButtonItem *flexible = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:self
action:nil];
UIBarButtonItem *clearButton = [[UIBarButtonItem alloc] initWithTitle:@"Clear"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(clearData)];
[toolBar setItems:[NSArray arrayWithObjects:cancelButton, clearButton, flexible, doneButton, nil]];
UIPickerView *pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0.0f, 44.0f, 320.0f, 216.0f)];
pickerView.showsSelectionIndicator = YES;
[pickerBackView addSubview:pickerView];
[pickerBackView addSubview:toolBar];
[pickerView release];
[doneButton release];
[cancelButton release];
[clearButton release];
[flexible release];
return pickerBackView;
}
No comments:
Post a Comment