はい、最初にいくつかのプロパティをZBarReaderViewControllerに設定しました
self.zReader.showsCameraControls = NO;
self.zReader.showsZBarControls=NO;
次に、カスタムを設定する必要があります。cameraOverlayView
たとえばUIToolBar
、左ボタンでピッカーをUISwitch
閉じ、aで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];
}