Question

Hello together I found on this side a very good tutorial to add a Pdf view to my xcode project.

Tutorial

But my problem at the end in ViewController .m the size for the pdf is set with

CGRect frame = CGRectMake(0, 100, 768, 800);

But this is for Ipad, how can I set it for iPhone, so that the pdf is showen fullscreen with navigationBar on top?

Thanks for help

Was it helpful?

Solution

Here you can use the frame of your parent controller that will be always true(if it displays correctly in iPhone and iPad).

Just like

//Gives the frame of parent controller.
CGRect frame=self.view.frame;

Now you can adjust Y offset as you needed. Ex.

frame.origin.y=100;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top