2013-11-20 5 views
1

내 앱에서보기 컨트롤러 계층이 상당히 복잡합니다. 현재 버튼이있는 전체 화면을 만들고 싶다는 견해가 있습니다. 문제는이 뷰가 화면의 일부만 차지하는 뷰 컨트롤러의 뷰 안에 있기 때문에 단순히 프레임을 애플리케이션 창 크기로 설정할 수 없다는 것입니다. 또한 내 UI의 나머지 부분을 방해 할 수 있으므로보기를 모달로 표시 할 수 없습니다. 나는 이미 전체 화면으로 확장하기 위해 뷰 컨트롤러 내부에 표시되는 것으로, 위의보기를 만들 필요가보기 컨트롤러의보기를 전체 화면으로 확대

UIViewController // root view controller 
    --> UIViewController 
     --> UIViewController 
     --> UIViewController 
    --> UIViewController 
     --> Controller's View <----- // this one 
    --> UIViewController 

:

무슨 뜻인지 설명하는 데 도움합니다.

가장 좋은 방법은 무엇입니까?

답변

1

나는이 도움을 희망하고있다. 전체 화면 비디오를 지원하는 비디오 플레이어가 있습니다.

것은이 코드를 참조하십시오, 당신은이 단지 내가 그것을 어떻게 보여 일부 변경 내 코드의 단지 일부와 같이 빠른 응답 .. 변경을 할

UIView *rootView = [[[[[UIApplication sharedApplication] delegate] window] rootViewController] view]; 
CGRect rect = [myView convertRect: myView.frame toView:rootView]; 
UIView *interactionView = [[UIView alloc] initWithFrame:rect]; 
interactionView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin; 
[interactionView.layer insertSublayer:myView.layer below:otherView.layer ];// i am using otherView u can use if any or use addSublayer otherwise 
myView.layer.frame = rootView.bounds; 
interactionView.frame = rootView.bounds; 
+0

감사합니다. @wuiii. 내가 원하는 방식으로 작업하게하려면 여러 가지 변경 작업을해야했습니다. 이것이 훌륭한 출발점이었습니다. – Taz

+0

@ Taz u r 환영 :-) –

0
UIView *yourview = yourViewController.view; 

    [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade]; 

    [UIView beginAnimations:nil context:nil]; 
    [UIView setAnimationDuration:.5]; 
    yourview.frame = [[UIApplication sharedApplication].windows.lastObject frame]; 
    [UIView commitAnimations]; 
+0

감사 니 코스 필요하지만 것 이 작동하지 않습니다. 이유는 프레임이 애플리케이션의 창 크기로 조정되고 이론적으로는 작동하지만 뷰가 현재 뷰의 절반 크기 (iPad 화면의 절반 정도)로 표시되기 때문에 뷰의 크기가 조정되지만 ... 부모보기의 {0,0}에서 시작합니다. iPad 화면으로 변환하면 {524,0}이 될 수 있습니다. – Taz

관련 문제