我有一個只支持橫向模式的IPAD應用程序。在我想用ZbarSDK閱讀條形碼時,我在我的視圖控制器中創建了一個視圖,然後將它加載到readerviewcontroller的背景中。在iphone中可以很好地工作。但是,在這種定向的ipad中,它的行爲非常流暢,就像在縱向模式下加載等我使用這個,但沒有運氣。 reader.supportedOrientationsMask = ZBarOrientationMask(UIInterfaceOrientationLandscapeRight
任何人都可以幫助我如何正確使用這個sdk在ipad與風景方向?ZBar SDK orientation在Ipad中的問題?
回答
我想用波紋管代碼可能這個幫助你...
ZBarReaderViewController *reader = [ZBarReaderViewController new];
[reader shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeRight];
希望,這幫助你.. :)
同樣是由我在設置宏 – hacker
和你的主viewController後自動旋轉是或否? –
你也可以從這個鏈接找到一些東西..http://zbar.sourceforge.net/iphone/sdkdoc/ –
工作正常,我。我們的iPad應用程序僅支持橫向方向:
// ADD: present a barcode reader that scans from the camera feed
ZBarReaderViewController *reader = [ZBarReaderViewController new];
reader.readerDelegate = self;
ScanOverlay overlayController = [[ScanOverlay alloc] initWithNibName:@"ScanOverlay" bundle:nil];
reader.cameraOverlayView = overlayController.view;
ZBarImageScanner *scanner = reader.scanner;
// TODO: (optional) additional reader configuration here
reader.supportedOrientationsMask = UIInterfaceOrientationMaskLandscape;
reader.wantsFullScreenLayout = YES;
reader.showsZBarControls = NO; //If we don't set this to NO, the overlay may not display at all
reader.tracksSymbols = YES;
[overlayController willRotateToInterfaceOrientation:YES duration:0.5];
// ADD: present a barcode reader that scans from the camera feed
// EXAMPLE: disable rarely used I2/5 to improve performance
[scanner setSymbology: ZBAR_I25
config: ZBAR_CFG_ENABLE
to: 0];
//Show the scanner view
if([self respondsToSelector:@selector(presentViewController:animated:completion:)]){
[self presentViewController:reader animated:YES completion:^(void){}];
} else if([self respondsToSelector:@selector(presentModalViewController:animated:)]) {
[self presentModalViewController:reader animated:YES];
} else {
NSLog(@"Error! Can't present the View Controller");
}
我剛剛與嵌入式閱讀器視圖的問題和閱讀到setNeedsLayout呼叫失蹤的旋轉,不知道這是否會幫助別人,但這裏是固定的我問題
- (void) willRotateToInterfaceOrientation: (UIInterfaceOrientation) orient duration: (NSTimeInterval) duration
{
[self.readerView willRotateToInterfaceOrientation:orient duration:duration];
[self.readerView setNeedsLayout];
}
爲我解決了旋轉問題,謝謝! – Tolstiy
- 1. Zbar在vs2015鏈接問題
- 2. CSS Orientation風景問題android
- 3. iOS Face Up Orientation問題
- 4. zbar #ifdef在iOS中使用minizip問題
- 5. 使用zbar sdk的條碼閱讀器
- 6. Zbar問題(ZbarSymbolSet)和Xcode8
- 7. zbar QR碼解碼問題
- 8. Zbar導入庫問題
- 9. ZBar SDK沒有嘟嘟聲
- 10. Zbar SDK無法在iOS6中工作
- 11. ZBar SDK在IOS7中變慢了
- 12. 如何在camerabar中添加tabbar zbar sdk
- 13. ZBar SDK與IOS的集成
- 14. AVCapture使用zbar和SDK
- 15. zbar SDK不適用於armv7s(iPad 4 iOS 7)
- 16. UIPanGestureRecognizer在iPad中的問題
- 17. 如何在通用應用程序(iphone和ipad)中使用zbar sdk?
- 18. 檢查Zbar SDK中的條碼值?
- 19. ARM平臺的x11 zbar編譯問題
- 20. 問題在iPad上
- 21. Leopard中的iPad SDK
- 22. Twitter API問題iPad
- 23. 問題在iPad中的UISplitViewController中
- 24. 用於在iPad中進行橫向拍攝的ZBar
- 25. iPad中的UITableView問題?
- 26. iPad中的定位問題?
- 27. XCode iPad中的AutoLayout問題
- 28. modalView問題中的iPad UIActionSheet
- 29. iPad中的字體問題
- 30. zbar和代碼IOS SDK定製
您是否找到解決此問題的解決方案?我現在也有這個相同的問題。你可以幫我嗎?? – Ananth