0

i want to open QLPreVIewController as a from sheet model style.

Here is my code

    -(void)openPdfFile{

    QLPreviewController *previewer = [[QLPreviewController alloc] init];

    [previewer setModalPresentationStyle:UIModalPresentationFormSheet];
    [previewer setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];


    // Set data source
    [previewer setDataSource:self];
    [previewer setDelegate:self];
    // Which item to preview
    [previewer setHidesBottomBarWhenPushed:TRUE];

    [[[[UIApplication sharedApplication]keyWindow]rootViewController]presentModalViewController:previewer animated:TRUE];

}

but it always present with full screen

help please

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Sunny Shah
  • 12,990
  • 9
  • 50
  • 86

1 Answers1

0

From the docs:

You can push it into view using a UINavigationController object, or can present it modally, full screen

So, you could try presenting a navigation controller as a form sheet and pushing the preview controller as the root view controller.

Wain
  • 118,658
  • 15
  • 128
  • 151
  • it works for me.but now problem is that i have added left bar button in navigation controller. but it doesnt display – Sunny Shah Jul 12 '13 at 09:29
  • The bar buttons are specified by the preview controller. What did you try to do (you may want to start a new question). – Wain Jul 12 '13 at 09:58
  • Here is my new question. http://stackoverflow.com/questions/17612906/qlpreviewviewcontroller-cant-set-left-bar-button-in-less-than-6-0-version – Sunny Shah Jul 12 '13 at 10:32