1
votes

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.

4
your status bar color is light content..???Mayank Jain
yes status bar is light content throughout applicationSarthak Patel

4 Answers

1
votes

Try This...

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

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

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

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];
0
votes

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.