我正在使用zbarsdk来读取条形码.它工作正常,但我的问题是我已经将覆盖视图添加到ZBarReaderViewController(我的代码中的阅读器).所以现在我尝试添加点按以聚焦功能.但它正在崩溃.以下是我的代码.提前致谢 .任何想法都会感激不尽.
-(IBAction)scanBarCode:(id)sender
{
barcodeClicked = 1;
NSLog(@"TBD: scan barcode here...");
// ADD: present a barcode reader that scans from the camera feed
reader = [ZBarReaderViewController new];
reader.readerDelegate = self;
reader.supportedOrientationsMask = ZBarOrientationMaskAll;
ZBarImageScanner *scanner = reader.scanner;
// TODO: (optional) additional reader configuration here
// EXAMPLE: disable rarely used I2/5 to improve performance
[scanner setSymbology: ZBAR_I25
config: ZBAR_CFG_ENABLE
to: 0];
reader.showsZBarControls = NO;
UIView *ovlView = [[UIView alloc] init];
[ovlView setFrame:CGRectMake(0, 0, 320, 480)];
[ovlView setBackgroundColor:[UIColor clearColor]];
UIImageView *leftBracket = …Run Code Online (Sandbox Code Playgroud) 我使用Xcode 3.2开发了一个iOS应用程序,我想发布一个支持更大的iPhone 5屏幕的应用程序的新版本.
我在Application Delegate中尝试了以下内容:
[window setFrame:[[UIScreen mainScreen] bounds]];
[window addSubview:viewController.view];
[window makeKeyAndVisible];
CGRect screenBounds = [[UIScreen mainScreen] bounds];
NSLog(@"%@",[NSValue valueWithCGRect:screenBounds]);
// NSRect: {{0, 0}, {320, 480}}
Run Code Online (Sandbox Code Playgroud)
如您所见,高度设置为480pt.如何添加对iPhone 5更高屏幕的支持?
谢谢,
我想实现一个测量相机和聚焦物体之间距离的应用程序.请帮我启动这个应用程序.即使我不知道如何启动这个应用程序.请给我一些想法.