Как я могу уменьшить надписи на панели параметров с помощью UIDocumentInteractionController - PullRequest
0 голосов
/ 17 июня 2020

Я использую это для инициализации представления документа.

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];
}

Работает, это экран. enter image description here

Моя проблема в том, что надписи слишком высоки. Как можно немного понизить? Спасибо за внимание.

1 Ответ

0 голосов
/ 22 июня 2020

Вот где я нахожу решение. У вас есть 2 варианта:

//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];
}

Скрыть строку состояния при использовании UIDocumentInteractionController?

Это потому, что по умолчанию панель не настроена должным образом.

...