无论如何,我的取消按钮正在拉起相机胶卷。我该如何删除它。
- (void)cameraButtonClick:(id)sender {
mediaPicker = [[UIImagePickerController alloc] init];
//[mediaPicker setDelegate:self];
mediaPicker.allowsEditing = YES;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"Take photo", @"Choose Existing", nil];
[actionSheet showInView:self.view];
}
// If device doesn't has a camera, Only "Choose Existing" option will show up.
else {
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"Choose Existing", nil];
[actionSheet showInView:self.view];
}
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){
if (buttonIndex == 0) {
[capture showImagePicker:self.navigationController popoverRect:CGRectMake(0.0f, 0.0f, 0.0f, 0.0f)];
} else if (buttonIndex == 1) {
capture = [[VFPhotoCaptureController alloc] init];
}
}
else{
if (buttonIndex == 0) {
capture = [[VFPhotoCaptureController alloc] init];
}
}
[self presentModalViewController:mediaPicker animated:YES];
}
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
[picker dismissModalViewControllerAnimated:YES];
}