2011-08-13 8 views
2

안녕 모두 내 카메라 오버레이에 UITextField를 추가하려고합니다. 내 카메라보기에 표시되고 있지만 편집 할 수는 없습니다. 그것은 전혀 응답하지 않습니다. 다시 연결하려면 어떤 접근 방식이 필요합니까?카메라 오버레이에 UITextField 추가

이 질문을 살펴 봤지만 투명 카메라를 오버 뷰 투명 컨트롤러로 설정하는 방법을 이해하지 못했습니다. 사전에

Suggestion for camera overlay

감사합니다!

답변

3

단계는 다음과 같아야합니다

  1. 당신의 선택 도구를 만듭니다.

  2. clearColor 배경으로 빈보기를 만듭니다.

  3. 은 addSubview 사용하여 텍스트 필드를 추가 뷰에 2 단계에서

  4. 설정 cameraOverlayView을

  5. 당신의 선택 도구를 제시 2 단계에서 만든보기로. 코드에서

은 : 그것은, 일부 오타가 희망이 도움이 수 있도록

//self.picker and self.textField being your UIImagePickerController and UITextField instances. 
emptyView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; //This frame will make it fullscreen... 
emptyView.backgroundColor = [UIColor clearColor]; 
[emptyView setAlpha:1.0]; //I think it is not necessary, but it wont hurt to add this line. 
self.textField.frame = CGRectMake(100, 100, self.textField.frame.size.width, self.textField.frame.size.height); //Here you can specify the position in this case 100x 100y of your textField preserving the width and height. 
[emptyView addSubview:self.textField]; 
self.picker.cameraOverlayView = emptyView; //Which by the way is not empty any more.. 
[emptyView release]; 
[self presentModalViewController:self.picker animated:YES]; 
[self.picker release]; 

나는 여기에 자신의 코드를 입력!

+0

굉장한 사람! 매력처럼 일했다. "transparentColor"를 "clearColor"로 변경해야했습니다. – Louie

+0

모든 사람이 사용할 수 있도록 코드가 업데이트되었습니다. –