启用QLPreviewController

问题描述:

风景模式在我使用我的QLPreviewController iPhone应用程序。我如何可以启用它横向模式?启用QLPreviewController

+0

按照此为iOS 6 http://*.com/questions/13758398/orientation-is-not-working-in-ios6/13758480#13758480 – Rajneesh071 2013-02-11 11:17:00

试着用下面:

在 “AppDelegate中”

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{ 
return UIInterfaceOrientationMaskLandscape; 
} 

在你们各自的 “视图控制器” 中,你必须实行 “QLPreviewController”

以下地址:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) 
    return YES; 
else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) 
    return YES; 
else 
    return NO; 
} 

希望,这将是对你有所帮助。

干杯!

+0

我使用ios6(有一个标签ios 6),我有试过它对我不起作用 – revolutionkpi 2013-02-11 10:55:56

在应用程序委托这样做也无济于事。创建的UIVieController , UITabbarController (if you are using one in your app)延伸并覆盖NISHANT乙已为您提供有这两种方法。这两个是在iOS6的添加了两个新的API。