I'm using the ZBar SDK to read QR codes on iPhone, however I want to add some text to the bottom of the camera/scanner view that is instructional text for the user. Here is what I have so far:
UIView *cameraOverlayView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
cameraOverlayView.backgroundColor = [UIColor redColor];
UILabel *instructionLabel = [[UILabel alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
[instructionLabel setTextColor:[UIColor grayColor]];
[instructionLabel setBackgroundColor:[UIColor clearColor]];
[instructionLabel setFont:[UIFont fontWithName: @"Trebuchet MS" size: 24.0f]];
[instructionLabel setCenter:cameraOverlayView.center];
[cameraOverlayView addSubview:instructionLabel];
reader.cameraOverlayView = cameraOverlayView;
reader.wantsFullScreenLayout = YES;
[instructionLabel release];
[cameraOverlayView release];
Here is the full class:
https://gist.github.com/4163761
Unfortunately, the label doesn't show. ZBar's documentation says to use the cameraOverlayView for this purpose, however it doesn't seem to be working.
One other note, I'm using the Titanium framework, so that's where the extra Titanium classes are from, however my question should be specific to ZBar.