iOS camera overlay view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation OverlayView | |
- (id)initWithFrame:(CGRect)frame { | |
if (self = [super initWithFrame:frame]) { | |
//clear the background color of the overlay | |
self.opaque = NO; | |
self.backgroundColor = [UIColor clearColor]; | |
//load an image to show in the overlay | |
UIImage *searcher = [UIImage imageNamed:@"searcher.png"]; | |
UIImageView *searcherView = [[UIImageView alloc] | |
initWithImage:searcher]; | |
searcherView.frame = CGRectMake(30, 100, 260, 200); | |
[self addSubview:searcherView]; | |
[searcherView release]; | |
//add a simple button to the overview | |
//with no functionality at the moment | |
UIButton *button = [UIButton | |
buttonWithType:UIButtonTypeRoundedRect]; | |
[button setTitle:@"Scan Now" forState:UIControlStateNormal]; | |
button.frame = CGRectMake(0, 430, 320, 40); | |
[self addSubview:button]; | |
} | |
return self; | |
} | |
... | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment