У меня есть cameraOverlayView
, который работает в определенной степени. Когда UIImagePickerController
называется стандартные элементы управления не отображаются и «Take фотографию» кнопку и logo.jpg показаны как описано в ObViewControllerCameraOverlay. Кнопка функционирует так, что при нажатии она становится синей, но моя проблема в том, что она не вызывает действие (NSLog просто предназначен для тестирования). Может ли кто-нибудь увидеть, что я мог сделать неправильно?Кнопка на cameraOverlayView не работает
@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");
}
Brilliant - спасибо. – RGriffiths