【发布时间】:2015-05-22 06:30:12
【问题描述】:
当我将图像从相机上传到我的 imageview 图像成功上传但我的状态栏变得隐藏。我在 iOS 上比较新。请帮忙。应用程序委托中的任何我设置。他们隐藏了我的状态栏。任何帮助将不胜感激。
[application setStatusBarStyle:UIStatusBarStyleLightContent];
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:NO];
and i m setting in info.plist
View controller-based status bar appearance NO
-(IBAction)choosePicture:(id)sender
{
imagePicker=[[UIImagePickerController alloc]init];
imagePicker.sourceType=UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.delegate=self;
[self presentViewController:imagePicker animated:YES completion:nil];
}
-(IBAction)takePicture:(id)sender
{
imagePicker=[[UIImagePickerController alloc]init];
imagePicker.sourceType=UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;
[self presentViewController:imagePicker animated:YES completion:nil];
}
-(void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info
{
pickedImage=[info objectForKey:UIImagePickerControllerOriginalImage];
[self performSelectorInBackground:@selector(saveImage:) withObject:nil];
image.image=pickedImage;
pickedImage = [self compressImage:pickedImage];
pickedImageData=UIImageJPEGRepresentation(pickedImage,0.9);
[self dismissViewControllerAnimated:YES completion:nil];
}
-(void)navigationController:(UINavigationController *)navigationController
willShowViewController:(UIViewController *)viewController
animated:(BOOL)animated
{
[[UIApplication sharedApplication] setStatusBarHidden:YES];
}
-(BOOL)prefersStatusBarHidden // also do this for iOS 8
{
return YES;
}
【问题讨论】:
-
请添加您的代码.. 到目前为止您所做的一切。
标签: ios objective-c iphone uiimagepickercontroller