Hi! I’m using the iOS SDK version 8.1.2 via SPM and running into a visual issue when using hidesBottomBarWhenPushed.
My app uses a toolbar as the primary nav between most of our “core” screens. When I need to send the user to view a doc in PDFTron, I set “hidesBottomBarWhenPushed = true” just before pushing the PTDocumentController onto the navigation controller.
When I do that, I get a black bar along the bottom of the screen between the document area and the PDFTron toolbar. If I set “PTDocumentController = false”, I of course still see my app’s toolbar, but the black bar is not there anymore.
Is there a way for me to hide MY app toolbar and NOT have that black bar along the bottom?
(In the screenshots, there actually is a PDF with content, but I edited the image to hide the content.)
Thank you for getting in touch with us about this.
If you disable the pageFitsBetweenBars property on the viewer then the black bar shouldn’t appear.
documentController.pageFitsBetweenBars = false
Does that work for you?
That does the trick! The black stripe is gone, thanks!
I do seem to have a curious side effect now on the view controller I use to present the PDF viewer though. I will poke at it on Monday to see if it’s something I may be doing…
I’m sharing 2 new screenshots for comparison. Before I launch the PDF viewer, my background is all white. But after I launch, and dismiss the viewer, I now have a light gray’ish stripe along the bottom that looks to be about where the black stripe was in my previous screen shots.
Ok, coming back to this one. I see what’s causing my screen to be wrong, but I’m not sure WHY or what to do about it.
When I use the “pageFitsBetweenBars” option, it DOES fix my original issue (the black bar is gone). But…now when I dismiss the PTDocumentController, my previous view has had its safe area modified. Since I use the safe area for my constraints, this causes my UI to be wrong.
i.e. When I print the value for “self.view.safeAreaInsets” on MY view controller, it has changed after dismissing the PTDocumentController. Specifically, the “bottom” value has changed, and now I have a gap in my UI of about 50.
Any ideas on how I can compensate for that?
Just coming back to this. We recently made a new release of the PDFTron iOS SDK which deprecates the
pageFitsBetweenBars property as we made some changes to how the viewer is laid out.
Are you able to update and let us know how it works for your UI? If there are still issues with the bottom bar using the latest release then we can try to figure out the best approach to resolve them.
I’m really liking the 9.0 release so far, thank you for the hard work! I was able to delete the call to set the pageFitsBetweenBars property, and my original issue is still ok. i.e. We’re good on that one.
I do still have the issue of this “gray bar” when I return from the PDF view controller. I’m attaching 3 screenshots of what I see “before I launch the viewer”, “with the viewer open”, and “after I leave the viewer”.
Notice that the background is all white until you reach the black tab bar at the bottom.
Still good, no visible gap between the main view area and the “Submit” button.
Now we have a dead gray area above the black task bar. When I look behind the scenes, my “safe area” has been modified for some reason.
This seems to be related to my making use of the “toolbarItems” property. That’s how I’m getting that “Submit” button to appear.
private func configureToolbar()
let leftSpacer = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
let submitButton = UIBarButtonItem(title: "Submit", style: .plain, target: self, action: #selector(submitButtonPressed))
let rightSpacer = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
self.toolbarItems = [leftSpacer, submitButton, rightSpacer]