I am facing some problem after integrating ZBar
framework for scanning QRCodeRead
on my apps. My client wants, QRCode Scanner will be in a fixed frame and must not be a PresentModalView
. So I write code for fixed frame QRCode Scanner and added the reader.view
on self.view
, but it not working as presentModalViewController:reader
. I don't know what is going wrong. I am not able to solve this issue. I have provided my code below and Sorry for my bad English.
This Code is working...
- (IBAction) scanButtonTapped
{
ZBarReaderViewController *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];
// present and release the controller
[self presentModalViewController:reader animated:YES];
[reader release];
}
But this Code is not working...
- (IBAction) scanButtonTapped
{
// Create new reader
ZBarReaderViewController *reader = [ZBarReaderViewController new];
reader.readerDelegate = self;
[reader.scanner setSymbology:ZBAR_I25 config:ZBAR_CFG_ENABLE to:0];
reader.showsCameraControls = NO;
reader.showsZBarControls = NO;
[reader setWantsFullScreenLayout:NO];
reader.showsHelpOnFail = NO;
reader.showsZBarControls = NO;
[reader.view setFrame:CGRectMake(20, 134, 280, 202)];
[self.view addSubview:reader.view];
[reader release];
}
Please help me and provide a solution.Thanks in advance.