Sarthak Patel
Sarthak Patel

Reputation: 129

Status bar Hidden Issue, when present QLPreview controller

Following is my code:

QLPreviewController *previewController=[[QLPreviewController alloc]init];

previewController.delegate = self;
previewController.dataSource = self;
[self presentViewController:previewController animated:YES completion:NULL]; 

I have set ViewController based status bar property to NO.

When I present QLPreviewController, the status bar is hidden. Kindly tell me the solution of this problem.

Upvotes: 1

Views: 2629

Answers (4)

Matt
Matt

Reputation: 248

In iOS 7, if your view controller class is actually a navigation controller you will need to override the - (BOOL)prefersStatusBarHidden method of the view controller it is showing.

Upvotes: 0

Mayank Jain
Mayank Jain

Reputation: 5754

Try This...

QLPreviewController *previewController=[[QLPreviewController alloc]init];
previewController.delegate = self;
previewController.dataSource = self;
[self presentViewController:previewController animated:YES completion:^{ [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];}];

Upvotes: 1

Justin Johns
Justin Johns

Reputation: 406

If you're not using view controller-based status bar control (which makes sense for apps that are compatible with iOS6 and earlier), you can take control of whether a status bar is shown by adding a line to your presented view controller's viewWillAppear: method. To show the status bar, add

[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:NO];

Upvotes: 0

Pooja M. Bohora
Pooja M. Bohora

Reputation: 1331

Check if below properties are set like this in your applications info.plist file.

<key>UIStatusBarHidden</key>
    <true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>

Upvotes: 0

Related Questions