From bc944fea99a7c894b33a7964e3470417ac818182 Mon Sep 17 00:00:00 2001 From: TJ Woon Date: Fri, 27 Feb 2015 18:41:44 +0800 Subject: [PATCH] Restore/update the hack for hiding ZBar scanner Info button on iOS --- ios/CsZBar.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ios/CsZBar.m b/ios/CsZBar.m index 0f5b81d..6df2520 100644 --- a/ios/CsZBar.m +++ b/ios/CsZBar.m @@ -60,10 +60,10 @@ self.scanReader.cameraFlashMode = UIImagePickerControllerCameraFlashModeOff; } - // Hack to hide the bottom bar's Info button... http://stackoverflow.com/a/16353530 - //UIView *infoButton = [[[[[self.scanReader.view.subviews objectAtIndex:1] subviews] objectAtIndex:0] subviews] objectAtIndex:3]; - //[infoButton setHidden:YES]; - + // Hack to hide the bottom bar's Info button... originally based on http://stackoverflow.com/a/16353530 + UIView *infoButton = [[[[[self.scanReader.view.subviews objectAtIndex:2] subviews] objectAtIndex:0] subviews] objectAtIndex:3]; + [infoButton setHidden:YES]; + BOOL drawSight = [params objectForKey:@"drawSight"] ? [[params objectForKey:@"drawSight"] boolValue] : true; if(drawSight){ CGRect screenRect = [[UIScreen mainScreen] bounds]; @@ -74,11 +74,11 @@ //polygonView.center = self.scanReader.view.center; //polygonView.layer.borderColor = [UIColor greenColor].CGColor; //polygonView.layer.borderWidth = 3.0f; - + UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(dim / 2, 0, 1, dim)]; lineView.backgroundColor = [UIColor redColor]; [polygonView addSubview:lineView]; - + self.scanReader.cameraOverlayView = polygonView; //[self.scanReader.view addSubview:polygonView]; }