iPadで動作するコードを実行しましたが、私はiPadでのサポートのためにZbar 1.2.2ベータ版を使用しています。Zbar cameraOverlay UIBarItemのクリックがうまくいきません
ZBarReaderViewController* mReader = [[ZBarReaderViewController alloc] init];
mReader.readerDelegate = self;
mReader.showsZBarControls = NO;
mReader.wantsFullScreenLayout = NO;
mReader.readerView.frame = CGRectMake(0, 0, UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height);
UIButton *imageView = [[UIButton alloc] init];
imageView.frame = CGRectMake(0, 0, UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height);
[self setupToolBar:imageView];
mReader.cameraOverlayView = imageView;
setupToolBar
今、私の質問
- (void)setupToolBar:(UIButton*)imageView
{
[imageView retain];
UIToolbar* imagePickerToolBar = [[UIToolbar alloc] init];
UIImage *c = [UIImage imageNamed:@"close.png"];
UIBarButtonItem *closeItem = [[UIBarButtonItem alloc] initWithImage:c style:UIBarButtonItemStylePlain target:self action:@selector(closeBarItemPressed:)];
NSArray *items = [NSArray arrayWithObjects: closeItem, nil];
[imagePickerToolBar setItems:items animated:NO];
imagePickerToolBar.frame = CGRectMake(0, UIScreen.mainScreen.bounds.size.height - imagePickerToolBar.frame.size.height, imagePickerToolBar.frame.size.width, imagePickerToolBar.frame.size.height);
[imageView addSubview:imagePickerToolBar];
[imageView bringSubviewToFront:imagePickerToolBar];
[imagePickerToolBar release];
[closeItem release];
[imageView release];
}
次ん:
closeBarItemPressed:
が呼び出さ取得されていないが、なぜ、どのようにそれを修正するために?
closeBarItemPressed:メソッドを追加できますか? – Cyprian
私はちょうどそこに何も特別なログオンはありません... – deimus