문제

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];
}
도움이 되었습니까?

해결책

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];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top