Thursday, July 1, 2010

Customize view on Camera View.

STEPS:

step 1. Load the xib which will contain camera view...
step 2. Now load camera on that xib.
step 3. Now load the view (addSubView) on camera.cameraOverlayView.

camera.m


//********************************* CAMERA VIEW CODE*******************************
camera = [[UIImagePickerController alloc] init];
camera.view.backgroundColor = [UIColor clearColor];
overView.frame = CGRectMake(0,44,320,416);
nvgView.frame = CGRectMake(0,0,320,44);

// [camera.view addSubview:overView];
// [camera.view addSubview:nvgView];


// Hide Apple's UI.
#if TARGET_IPHONE_SIMULATOR
camera.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
camera.navigationBarHidden = YES;
camera.toolbarHidden = YES;

[camera.view addSubview:overView];
[camera.view addSubview:nvgView];

#elif TARGET_OS_IPHONE
camera.sourceType = UIImagePickerControllerSourceTypeCamera;
camera.showsCameraControls = NO;
camera.navigationBarHidden = YES;
camera.toolbarHidden = YES;
camera.wantsFullScreenLayout = YES;
camera.cameraViewTransform = CGAffineTransformScale(camera.cameraViewTransform, 2.0f, 2.0f);

// Add the view to be overlaid
//camera.cameraOverlayView = overView;
[camera.cameraOverlayView addSubview:flipView];
[camera.cameraOverlayView addSubview:nvgView];

#endif

// Show the camera's view as a modal dialog.
[self presentModalViewController:camera animated:YES];
[self.view addSubview:camera.view];
//********************************** CAMERA VIEW END*******************************

No comments:

Post a Comment