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

有帮助吗?

解决方案

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;
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top