Hi!
I develop an augmented reality application and I have a problem with abutton that I have add as a subview in a uiimagepicker. The problem is that when I tap the button, the button does not respond.
This is my code:
Code:
-(IBAction)Camera{
UIImagePickerController *imgPicker = [[UIImagePickerController alloc]init];
imgPicker.allowsEditing = NO;
imgPicker.delegate = self;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){
imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
[NSThread detachNewThreadSelector:@selector(AnimationThread) toTarget:self withObject:nil];
imgPicker.showsCameraControls = NO;
imgPicker.navigationBarHidden = NO;
imgPicker.wantsFullScreenLayout = YES;
CGAffineTransform translate = CGAffineTransformMakeTranslation(0.0, 27.0);
imgPicker.cameraViewTransform = translate;
CGAffineTransform scale = CGAffineTransformScale(translate, 1.125, 1.125);
imgPicker.cameraViewTransform = scale;
ShotButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[ShotButton addTarget:self action:@selector(Shot) forControlEvents:UIControlEventTouchUpInside];
ShotButton.frame = CGRectMake(284.0, 442.0, 72.0,37.0);
ShotButton.center = CGPointMake(284.0, 442.0);
imgPicker.cameraOverlayView.userInteractionEnabled = YES;
[imgPicker.cameraOverlayView addSubview:ShotButton];
[imgPicker.cameraOverlayView bringSubviewToFront:ShotButton];
[self presentModalViewController:imgPicker animated:YES];
}
[imgPicker release];
}
Than you very much...