Reputation: 129
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
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
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
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
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