0

I'm using this to initialize the document view.

NSString * filename = [NSString stringWithFormat:@"Document_%d",key];
NSURL *URL = [[NSBundle mainBundle] URLForResource:filename withExtension:@"pdf"];
if (URL) {
  // Initialize Document Interaction Controller
  self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:URL];
  [self.documentInteractionController setUTI:@"com.adobe.pdf"];
  // Configure Document Interaction Controller
  [self.documentInteractionController setDelegate:self];
  // Preview PDF
  [self.documentInteractionController presentPreviewAnimated:YES];
}

It works, this is the screen. enter image description here

My problem is that the writings are too high. How can I lower it a little bit? Thank you for reading.

Braiam
  • 1
  • 11
  • 47
  • 78
redYmir
  • 113
  • 5

1 Answers1

0

This is where I find the solution. You have 2 choices:

//First solution
//This shows the whole status bar
[[UIApplication sharedApplication] setStatusBarHidden:NO];

//Second solution from the link below
- (UIViewController *) documentInteractionControllerViewControllerForPreview: (UIDocumentInteractionController *) controller
{
  //This hide the status bar completely
  [[[[UIApplication sharedApplication] delegate] window] setWindowLevel:UIWindowLevelStatusBar];

    return [[[[UIApplication sharedApplication] delegate] window] rootViewController];
}

Hide status bar when using UIDocumentInteractionController?

This is because, by default the bar is not properly setted.

redYmir
  • 113
  • 5