1

I've created an overlay view for a camera with two buttons, a take picture button and a switch camera button. Take picture should take the picture and switch camera should change the rear view and front view camera. Neither of the things work. I've made an app like this a few months ago, and everything worked fine. I have the same code, and I don't know why the buttons don't work anymore. Any input is appreciated! If code is necessary I'll be happy to put it up!

Here's some code:

These are the connected buttons:

-(IBAction)takePicture:(id)sender{
    NSLog(@"Taken");
    [self.picker takePicture]; //Picker is the UIImagePickerController
}

-(IBAction)switchCamera:(id)sender{
    if (self.picker.cameraDevice == UIImagePickerControllerCameraDeviceRear) {
         self.picker.cameraDevice = UIImagePickerControllerCameraDeviceFront;
    } else{
       self.picker.cameraDevice = UIImagePickerControllerCameraDeviceRear;
    }
}

I've connected the custom .xib view as to @property (nonatomic) IBOutlet UIView *overlay

A.J. S.
  • 218
  • 4
  • 15
  • put some code and also first give backGround color of your overlay view for checking that surly your overlay view covered/added button or not... – iPatel Oct 19 '13 at 05:38
  • I added some code, if you need anything other code let me know, and the buttons do show up, they just don't work when you tap on them – A.J. S. Oct 19 '13 at 05:44
  • i am telling you because i have same issue (overlap) with QRScan.. so check with **backGround color of your overlay view** – iPatel Oct 19 '13 at 05:46
  • and change @property (nonatomic, strong) IBOutlet UIView *overlay; – iPatel Oct 19 '13 at 05:47
  • I added the strong to the UIView property, and the background color set for the overlay in the .xib file is the White Color – A.J. S. Oct 19 '13 at 05:52
  • 1
    change color red and check your button displayed under red color or not ?? – iPatel Oct 19 '13 at 06:01
  • It doesn't, it displays under a black color! – A.J. S. Oct 19 '13 at 06:03
  • 2
    SO..that way// your you can not able to touch button because your button not on your overlap view... – iPatel Oct 19 '13 at 06:06
  • ahhh I see, but do you know why that is?? and is there a way to fix it? – A.J. S. Oct 19 '13 at 06:07
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/39543/discussion-between-ipatel-and-aj-s) – iPatel Oct 19 '13 at 06:10

0 Answers0