iOS 7状态栏中的UIImagePickerController [英] UIImagePickerController in iOS 7 status bar

查看:124
本文介绍了iOS 7状态栏中的UIImagePickerController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在io7中,视图顶部的状态栏是一场噩梦。很幸运,我设法让它工作,所以它将放在视图上方。我这样做:

In io7,the status bar on top a view is a nightmare.Fortunally i managed to make it work so it will be placed above the view.I did it like this:

- (void)viewDidLoad
{
    [super viewDidLoad];
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
         self.view.backgroundColor=[UIColor colorWithRed:(152/255.0) green:(204/255.0) blue:(51/255.0) alpha:1] ;
        CGRect frame = self.topNav.frame; frame.origin.y = 20;
        self.topNav.frame = frame;
    }
....
}

现在我的状态bar在我的导航栏上方。

Now my status bar is above my navigation bar.

但是当涉及到调用 UIImagePickerController 时,情况就不同了。上面的代码有没有效果。
我试图这样做:

But when it comes to calling UIImagePickerController things are different.The above code has no effect. I tried to do this:

- (void)showImagePickerForSourceType:(UIImagePickerControllerSourceType)sourceType
{


    UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];

 if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {

            CGRect frame = self.imagePickerController.frame; frame.origin.y = 20;
           self.imagePickerController.frame = frame;
        }

    imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
    imagePickerController.sourceType = sourceType;
    imagePickerController.delegate = self;
    self.imagePickerController = imagePickerController;
    self.imagePickerController.allowsEditing=YES;
....
}

,结果是:

我的状态栏(当显示相机拍照时)有可能在相机控制器上方吗?

Any chance that my status bar(when displaying the camera for taking pictures) above the camera controls?

谢谢。

推荐答案

我有同样的问题...并解决我的问题...
在.plist文件中添加密钥

I have same problem... and solve my proble... Add The key in .plist file

'View controller-based status bar appearance' and set to NO.

并在appDelegate中添加。

And add in appDelegate.

[application setStatusBarHidden:NO]; 
[application setStatusBarStyle:UIStatusBarStyleDefault]; 

注意: - 更改 ** setStatusBarStyle ** 根据您的应用背景颜色

Note:- change the **setStatusBarStyle** according to your app background color

这篇关于iOS 7状态栏中的UIImagePickerController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆