Question

I am creating the simple customized camera application. so. i tried to customize the buttons for flash setting button and capture. It worked for iPhone4 and iPhone4s... but unfortunately.. it shows the white screen on iPhone3gs. What's the problem?

#define CAMERA_TRANSFORM_X 1
#define CAMERA_TRANSFORM_Y 1

#define SCREEN_WIDTH  320
#define SCREEN_HEIGTH 480

- (void) showCamera
{    
    overlay = [[CustomOverlayView alloc]
               initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGTH)];
    overlay.delegate = self;

    self.picker = [[UIImagePickerController alloc] init];
    self.picker.delegate = self;
    self.picker.navigationBarHidden = YES;
    self.picker.toolbarHidden = YES;
    self.picker.wantsFullScreenLayout = YES;
    self.picker.sourceType = UIImagePickerControllerSourceTypeCamera;
    self.picker.showsCameraControls = NO;
    self.picker.cameraViewTransform = CGAffineTransformScale(self.picker.cameraViewTransform, CAMERA_TRANSFORM_X, CAMERA_TRANSFORM_Y);
    self.picker.cameraOverlayView = overlay;
    [self.view addsubview self.picker.view];
}
Était-ce utile?

La solution

Call your showCamera method in your root view controller viewDidLoad method, or in its init method if you don't use IB.

You should present your camera controller by using

[self.navigationController presentModalViewContoller:self.picker animated:NO];
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top