0

我正在创建简单的自定义相机应用程序。所以。我试图自定义闪光灯设置按钮和捕捉按钮。它适用于 iPhone4 和 iPhone4s……但不幸的是……它在 iPhone3gs 上显示白屏。有什么问题?

#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];
}
4

1 回答 1

0

在您的根视图控制器方法中调用您的 showCamera 方法,如果您不使用 IB viewDidLoad,则在其方法中调用。init

您应该使用

[self.navigationController presentModalViewContoller:self.picker animated:NO];
于 2012-07-09T07:27:28.030 回答