是的,您首先为您的 ZBarReaderViewController 设置了一些属性
self.zReader.showsCameraControls = NO;
self.zReader.showsZBarControls=NO;
然后你必须设置你的 custom cameraOverlayView
,例如这个UIToolBar
用左键设置一个来关闭选择器和一个UISwitch
来控制 flashMode:
self.zReader.cameraOverlayView=[self setOverlayPickerView];
- (UIView *)setOverlayPickerView{
UIView *v=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
[v setBackgroundColor:[UIColor clearColor]];
UIToolbar *myToolBar = [[UIToolbar alloc] init];
UIBarButtonItem *backButton=[[UIBarButtonItem alloc] initWithTitle:@"back" style:UIBarButtonItemStyleBordered target:self action:@selector(dismissOverlayView:)];
UISwitch *sw=[[UISwitch alloc] init];
[sw setOn:NO];
UIBarButtonItem *switchButton=[[UIBarButtonItem alloc] initWithCustomView:sw];
UIBarButtonItem *fixed=[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
[sw addTarget:self action:@selector(handleSwitchFlash:) forControlEvents:UIControlEventValueChanged];
[myToolBar setItems:[NSArray arrayWithObjects:backButton,fixed,switchButton,nil]];
[myToolBar setBarStyle:UIBarStyleDefault];
CGRect toolBarFrame;
toolBarFrame = CGRectMake(0, 436, 320, 44);
[myToolBar setFrame:toolBarFrame];
[v addSubview:myToolBar];
return v;
}
- (void)dismissOverlayView:(id)sender{
[self dismissModalViewControllerAnimated: YES];
}