我使用zbar SDK扫描二维码,任何人都可以帮我弄清楚如何使用zbar SDK添加市场和标签吗?
答案 0 :(得分:1)
我为我的应用做了这样的事。
ZBarReaderViewController *reader = [ZBarReaderViewController new];
reader.cameraOverlayView = [self CommomOverlay];
-(UIView *)CommomOverlay{
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,480)];
UIImageView *TopBar = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,58)];
[TopBar setImage:[UIImage imageNamed:@"topbar.png"]];
[view addSubview:TopBar];
UILabel *Toplabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 9, 300, 30)];
[Toplabel setFont:[UIFont fontWithName:@"Arial-BoldMT" size:11]];
[Toplabel setTextAlignment:UITextAlignmentCenter];
[Toplabel setBackgroundColor:[UIColor clearColor]];
[Toplabel setTextColor:[UIColor colorWithRed:76/255.0 green:76/255.0 blue:76/255.0 alpha:1.0]];
[Toplabel setNumberOfLines:1];
[Toplabel setText:@"Place QR code inside the viewfinder to scan "];
[TopBar addSubview:Toplabel];
UIImageView *FrameImg = [[UIImageView alloc] initWithFrame:CGRectMake(60,150,193,170)];
[FrameImg setImage:[UIImage imageNamed:@"frame.png"]];
[view addSubview:FrameImg];
return view;
}
答案 1 :(得分:0)
你不会使用zbar,你只需要使用普通的Xcode标签。观看this教程,它很棒,并将教你如何使用标签。他们在教程中使用的Xcode版本可能有点旧。