2016-08-12 10 views
0

전체 화면 : enter image description hereIOS는 : UIImagePickerController를 레이아웃에서 다시 돌아온 후이되었다 내가 이미지와 같은 앱 레이아웃 하바

그것은 머리글, 바닥 글과 함께 mainViewController을 가지고 있으며, 사이보기. 다른 ViewController는 다른 View Controller 뷰에로드됩니다. (머리글과 바닥 글은 다른 모든 ViewController에서 고정되어 있습니다). 내가 같이 UIImagePickerController를 호출 내보기 컨트롤러 중 하나에서 :

UIImagePickerController *picker = [[UIImagePickerController alloc] init]; 
picker.delegate = self; 
picker.mediaTypes =[UIImagePickerController availableMediaTypesForSourceType:picker.sourceType]; 
// picker.allowsEditing = YES; 
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; 
[self presentViewController:picker animated:YES completion:NULL]; 

및 복귀 후 내가 기본 위임 사용 문제

다시 돌아온 후

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { 


if([info[UIImagePickerControllerMediaType] isEqualToString:@"public.image"]) 
{ 
    { 
     //some code 
    } 
} 
else if([info[UIImagePickerControllerMediaType] isEqualToString:@"public.movie"]) 
{ 
    //some code 
} 

// self.imageView.image = selectedImage; 

[self dismissViewControllerAnimated:YES completion:nil]; 

}

을 내부보기 (다른보기 컨트롤러) UIImagePickerController에서 전체 화면되고 그것은 헤더 뒤에 간다 및 바닥 글.

1) 되돌아온 후에 크기 조정을 시도했습니다. 하지만 작동하지 않습니다. 그 중

- (void)navigationController:(UINavigationController 

*)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated 
{ 
    [[UIApplication sharedApplication] setStatusBarStyle:YES]; 
} 
-(BOOL)prefersStatusBarHidden // iOS8 definitely needs this one. checked. 
{ 
    return YES; 
} 

-(UIViewController *)childViewControllerForStatusBarHidden 
{ 
    return nil; 
} 

것도, Pleaes 도움말을 작동하지 않습니다 : 2) 나는이 코드를 추가했습니다. 는 어떤 도움을 어쩌면이 도움말을

---- 편집을 ---- 감사합니다. 다음 코드를 사용하여 기본보기 컨트롤러에 다른보기 컨트롤러를 표시합니다. main_view는 머리글과 바닥 글 간의보기입니다. 하고 새 페이지는 내가 내 UIpicker 전화보다 컨트롤러이며 전체 화면이되었다

New_page *np = [[New_page alloc] initWithNibName:@"New_page" bundle:nil]; 
uicontroller=np; 
[uicontroller.view setFrame:CGRectMake(0, 0, main_view.frame.size.width, main_view.frame.size.height)]; 
[main_view addSubview:uicontroller.view]; 
+0

확인 해결 될 수

[self dismissViewControllerAnimated:YES completion:nil]; 

쓰기 갈까요

[self presentViewController:picker animated:YES completion:NULL]; 

물품. –

+0

도움이 필요하십니까? 보기가 전체 화면이되지 않도록하려면? –

답변

0

나는이없는 한 간단한

[self dismissViewControllerAnimated:YES completion:nil]; 

에 의해

[picker dismissViewControllerAnimated:YES completion:NULL]; 

[self.presentingViewController dismissViewControllerAnimated:YES completion:nil]; 

를 대체하여 시도 할 것이다 두 번 해고 당할 이유가 없어?

아무튼, 현재 존재하는 viewcontroller는 없어야합니다. 그래서 같은 방법으로 당신은 당신이 후 해고라고하여 'viewWillAppear`의 어떤이있는 경우뿐만 아니라이

+0

먼저 다른 뷰 컨트롤러에서 UIImagePickerController를 사용했고 [picker dismissViewControllerAnimated : YES completion : NULL]이라고 불렀습니다. (하지만 행운을) 다음 나는 temp보기 컨트롤러를 만들고 그 중 하나에 피커를 불렀다 [피커 dismissViewControllerAnimated : 예 완료 : NULL]; 피커와 자기를 dissmis.presentingViewController dismissViewControllerAnimated : 예 완료 : 없음]; 내가보기에 임시 뷰 컨트롤러를 놓치지 않았다. 아무도 작동하지 않았다. –

+0

[self presentViewController : picker animated : YES completion : NULL]; 은 uipicker를 표시하고 [self dismissViewControllerAnimated : YES 완료 : nil]; UIcontroller를 닫습니다. 하지만 여전히 전체 화면이되었습니다. –