3
在此先感謝。 我想創建一個自定義相機view.Like這在iphone中自定義相機視圖
要在一個視圖控制器爲此,我已創建的另一個視圖控制器的實例,並在第二視圖 - 控制我創建的UIImagePickerController這樣的觀點:
-(void)showCamera
{
camController = [[UIImagePickerController alloc]init];
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
camController.sourceType = UIImagePickerControllerSourceTypeCamera;
}
camController.showsCameraControls = NO;
camController.navigationBarHidden = YES;
camController.toolbarHidden = YES;
camController.wantsFullScreenLayout = NO;
camController.cameraViewTransform = CGAffineTransformScale(camController.cameraViewTransform, 2.0f, 2.0f);
// Edited
//[self presentModalViewController:camController animated:YES];
}
和在第一視圖中的控制器:
cam = [[CamController alloc]init];
cam.view.frame = CGRectMake(5, 50, 310, 300) ;
[cam showCamera];
[self.view addSubview:cam.view];
//Edited
[self.cam presentModalViewController:self.cam.camController animated:NO];
[self performSelector:@selector(setFrame) withObject:self afterDelay:1.0];
[self.cam.camController.view setFrame:CGRectMake(10, 50, 300, 250)];
這是不實際工作。這是正確的過程。誰能幫我 。
你能指定「不工作」的本質嗎? – Caleb
@Caleb:感謝你的回覆。不工作意味着它不顯示任何東西。 –
@sandhya其實我正在做這種類型的項目,所以你已經完成了這個項目。請幫我 –