採取
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Override point for customization after app launch
[window addSubview:viewController.view];
[window makeKeyAndVisible];
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
// Get the view for preview and start preview
PLCameraController *cam = [PLCameraController sharedInstance];
UIView *view = [cam previewView];
[cam startPreview];
// Add the preview view to window
[window addSubview:view];
// Override point for customization after app launch
[window makeKeyAndVisible];
}
如果你只是需要一個 '全屏' 攝影機視圖,你可以繼承的UIImagePickerController
:
- (void)viewDidLoad {
[super viewDidLoad];
[self setSourceType:UIImagePickerControllerSourceTypeCamera];
[self setShowsCameraControls:FALSE];
[self.view setFrame:CGRectMake(0, 0, 320, 480)];
}
從SDK3.1,您可以使用cameraOverlayView
屬性來設置自定義相機UI控件。
該setFrame
不會使實際的相機視圖全屏 - 我不相信這是可能的真的 - 所以我想你可以離開這一點以及。