2012-10-08 29 views
0

我試圖迫使我的自定義相機覆蓋方向,但我在努力得到它的工作,我已經試過了,力水平方向自定義相機覆蓋

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight); 

} 

但是這似乎並沒有自Xcode更新至4.5版本以來,該工作已經完成。

另外,根據我的理解,上述不是最佳實踐,那麼在單一視圖上強制水平定向的正確方法是什麼?

回答

0

對於ios6,需要做以下的事情。

  • (BOOL)shouldAutorotate { 返回YES; }

- (NSUInteger)supportedInterfaceOrientations { 回報UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft; }