Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS - QLPreviewController - How to stop QuickLook from Rotating?
    primarykey
    data
    text
    <p>I have QuickLook (QLPreviewController) almost working how I want it, but because of the images characteristics I don't want it to rotate into portrait orientation.I have it configured in the "shouldAutoRotateToInterfaceOrientation" method to only return yes for landscape rotations (see code below for details) but it is still rotating to portrait.</p> <p><strong>Note:</strong> The shouldAutoRotateToInterfaceOrientation is a direct copy that is used in all of my view controllers for this project and it is working in the other view controllers.</p> <pre><code>// // documentViewer.m // #import "DocumentViewer.h" @implementation DocumentViewer @synthesize documents; // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) return YES; else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) return YES; else return NO; } - (void)viewDidLoad { [super viewDidLoad]; } //-(void)viewWillAppear:(BOOL)animated { // // self.userInteractionEnabled = YES; //} //Nessary for Enabling User Interaction - (BOOL)canBecomeFirstResponder { return YES; } -(void) createList:(NSString *) document { documents = [[NSArray arrayWithObjects:document, nil] retain]; } -(NSInteger) numberOfPreviewItemsInPreviewController: (QLPreviewController *) controller { return [documents count]; } - (id &lt;QLPreviewItem&gt;) previewController: (QLPreviewController *) controller previewItemAtIndex: (NSInteger) index { return [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:[documents objectAtIndex:index] ofType:nil]]; } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload