Ok, so I'm using the ZBar SDK to scan barcodes in my iPhone app. I've successfully implemented the sample code, but now I want to change the frame of the scanner view (i.e: To half the screen size). I've tried setting the frame of the reader's view in viewDidLoad, but it resizes itself. I know this is going to be one of those really simple things I just missed, but any help would be much appreciated. Cheers.
EDIT: I got it to work. Here's my code:
ZBarReaderViewController *reader = [ZBarReaderViewController new];
reader.readerDelegate = self;
ZBarImageScanner *scanner = reader.scanner;
[reader setShowsZBarControls:NO];
[reader.readerView setScanCrop:(CGRect){ { 0, 0 }, { 0.43, 1 } }];
[reader.readerView start];
[self.view addSubview:reader.view];
overlayView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
[listTableView setFrame:CGRectMake(0, 208, 320, 208)];
[overlayView addSubview:listTableView];
[self.view addSubview:overlayView];
Instead of using ZBarReaderViewController, try using ZBarReaderView. This worked for me and saved my lot of time. Hope it helps you.
ZBarReaderView*reader = [ZBarReaderView new];
ZBarImageScanner * scanner = [ZBarImageScanner new];
[scanner setSymbology: ZBAR_I25
config: ZBAR_CFG_ENABLE
to: 0];
reader = [reader initWithImageScanner:scanner];
reader.readerDelegate = self;
reader.tracksSymbols = YES;
reader.frame = CGRectMake(20, 38, 283, 347);
reader.torchMode = 0;
dispatch_async(dispatch_get_main_queue(), ^{[reader start];});
[self.view addSubview:reader];