我需要拍照Ÿ试试这个当删除状态栏而不是工作删除状态栏编程7
[UIApplication的sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]。
- (IBAction)botonCamara:(id)sender {
// Make sure camera is available
if ([UIImagePickerController
isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] == NO)
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"Camera Unavailable"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:nil, nil];
[alert show];
return;
}
if (imagePicker == nil)
{
imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.allowsEditing = YES;
}
[self presentViewController:imagePicker animated:YES completion:NULL];
}
#pragma mark - delegate methods
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = [info objectForKey:UIImagePickerControllerEditedImage];
UIImageWriteToSavedPhotosAlbum (image, nil, nil , nil);
[self dismissViewControllerAnimated:YES completion:NULL];
}
不起作用=(和尝试这个“[自我presentViewController:self.imagePicker动画:是完成:^ { [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];}];“ – Fabio