2012-06-04 20 views
1

我在橫向模式下設置相機/掃描儀時遇到問題,即使我將屏幕更改爲橫向,但相機/掃描儀仍然顯示爲垂直。zbar - 掃描儀框架,如何使其在橫向

我可以知道應該怎麼做才能解決這個問題嗎?在相機APi上還是應該在zbar庫上更改?

謝謝。

回答

1

你必須設置爲讀者方向掩碼:

reader.supportedOrientationsMask = ZBarOrientationMaskAll; 

您可以在ZBarReaderViewController編輯蒙:

// orientation set support 
#define ZBarOrientationMask(orient) (1 << orient) 
#define ZBarOrientationMaskAll \ 
(ZBarOrientationMask(UIInterfaceOrientationPortrait) | \  
ZBarOrientationMask(UIInterfaceOrientationPortraitUpsideDown) | \ 
ZBarOrientationMask(UIInterfaceOrientationLandscapeLeft) | \ 
ZBarOrientationMask(UIInterfaceOrientationLandscapeRight))