UIDocumentInteractioncontroller Прокрутка PDF и предварительный просмотр печати на панели навигации круга - PullRequest
1 голос
/ 26 мая 2020

Привет, я показываю PDF-файл с помощью UIDocumentInteractionController. Моя проблема в том, что я не могу изменить цвет панели навигации на странице PDF. И я столкнулся с проблемой прокрутки. Если я прокручиваю pdf вверх, панель навигации перекрывается в pdf. И еще одна проблема - страница предварительного просмотра печати также перекрывается. Пожалуйста, помогите мне любым телом.

- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset{

    if (scrollView.contentOffset.y < +50.0f) {

        targetContentOffset->y = +50.0f;

    }

    else {

        *targetContentOffset = CGPointZero;

        // Need to call this subsequently to remove flickering.

        dispatch_async(dispatch_get_main_queue(), ^{

            [scrollView setContentOffset:CGPointZero animated:YES];

            });

    }

}

-(void) openPreviewForFileAtPath:(NSString *)path {

    [UINavigationBar appearance].tintColor = [UIColor blueColor];

    NSURL *url = [NSURL fileURLWithPath:path];

    //download finished - open the pdf

    UIDocumentInteractionController *viewer = [UIDocumentInteractionController interactionControllerWithURL:url];

    // Configure Document Interaction Controller

    [viewer setDelegate:self];

    // Preview PDF

    [viewer presentPreviewAnimated:YES];

    [viewer presentOpenInMenuFromRect:CGRectMake(1, 1, 1, 1) inView:self.view animated:YES];

    // [viewer  presentOptionsMenuFromRect:self.view.bounds inView:self.view animated:YES];

    // self.progressView.hidden = YES;

    }

    - (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller {

        [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

        [UINavigationBar appearance].barTintColor = [UIColor blueColor];

        [UINavigationBar appearance].tintColor = [UIColor blueColor];

        [UINavigationBar appearance].translucent = YES;

        [UINavigationBar appearance].titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor blackColor]};

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

}

enter image description here

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...