我有以下cameraOverlayView
工作在一定程度上。调用时UIImagePickerController
,标准控件不显示,“拍照” 按钮和logo.jpg显示为ObViewControllerCameraOverlay中所述。该按钮的功能是按下时变为蓝色,但我的问题是它没有调用该操作(NSLog 仅用于测试目的)。谁能看到我可能做错了什么?
@implementation ObViewControllerCameraOverlay
- (id)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame])
{
UIImage *logo = [UIImage imageNamed:@"logo.jpg"];
UIImageView *logoView = [[UIImageView alloc] initWithImage:logo];
logoView.frame = CGRectMake(0, 0, 240, 50);
[self addSubview:logoView];
UIButton *takePhotoButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[takePhotoButton setTitle:@"Take photo" forState:UIControlStateNormal];
takePhotoButton.frame = CGRectMake(0, 330, 320, 40);
[self addSubview:takePhotoButton];
}
return self;
}
- (IBAction)takePhotoButton:(id)sender
{
NSLog(@"test");
}