안녕하세요. 내 앱에서 화면 방향을 제공하려고 노력하고 있으며 많은 온라인 문서를 읽었지 만 시도 할 때 총 재난입니다 (에뮬레이터와 아이폰을 사용해 보았습니다). 화면이 가로로 회전하면 뷰의 절반이 더 이상 보이지 않습니다. 그들의 위치는 왼쪽에 있고 오른쪽은 비어 있습니다. 플러스하면 다음보기 컨트롤러를 연 다음 다시 회전합니다. 첫 번째보기의 두 번째보기 부분을 볼 수 있습니다. 끔찍한 부분입니다. 어떻게 수정해야할지 모르겠습니다. (방향을 세로로 고정 할 가능성을 차단하는 것을 제외하고). 나는 안드로이드에서 당신이 초상화와 풍경을위한 다양한 xml 레이아웃을 제공 할 수 있음을 안다. 그 아이폰에 그 fo fo하는 방법이 있습니까? 그렇다면 어떻게? iphone screen orientation
내 각보기
는 컨트롤러 구성하고 거기에 "주"컨트롤러는 다른 컨트롤러가 그렇게라고 를 .xib됩니다 또한ayuda=[[AyudaView alloc]
initWithNibName:@"AyudaView"
bundle:nil];
[self.view addSubview:ayuda.view];
내가 이미 maincontroller 이러한 metods을 추가 한 : here 를 표시하고 자동 크기의 PARAM로 재생하려고했지만 그것은 단지 더 악화
를 얻을 수- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
if(UIDeviceOrientationIsValidInterfaceOrientation(orientation)) {
[self handleInterfaceRotationForOrientation:orientation];
}
}
#pragma mark -
#pragma mark Screen Orientation Handling
- (void)handleInterfaceRotationForOrientation:(UIInterfaceOrientation)interfaceOrientation {
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
[self handleInterfaceRotationForOrientation:interfaceOrientation];
return YES;
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
[self handleInterfaceRotationForOrientation:toInterfaceOrientation];
}
로
당신에게
편집 대단히 감사합니다 확인 내가 읽고있는 좀 더 :
http://www.geckogeek.fr/iphone-forcer-le-mode-landscape-ou-portrait-en-cours-dexecution.html
을 기본적으로 제가 발견하면 있지만이 컨트롤러를 작성해야한다는 것입니다 해결책은 nib 파일 때문에 나에게 문제가된다. 나는 또한 2 개의 펜촉을 만들어 코드 양을 두 배로 늘려야한다는 것을 의미한다 (또는 위의 라이브러리를 사용한다). 내 텍스트 필드에 값이 있으면 어떻게해야합니까?
일이 어떻게 작동하는지 거의 알지 못하므로 전체 솔루션을 보지 않고 대답하는 것이 매우 어렵습니다. 그리고 Stack Overflow는 그렇게 작동하지 않습니다. 나는 당신에게 구글 코코아 인터페이스 방향 튜토리얼을 제안하고, 천천히 간다. 더 복잡한 경우에서 더 복잡한 경우로 진행한다. – zoul
이와 관련한 Apple 설명서를 읽으셨습니까? –