내 응용 프로그램은 모든 방향을 지원하지만 경우에 따라iPhone에서 화면을 세로/가로로 고정하는 방법은 무엇입니까?
세로/가로 모드로 화면을 잠그고 자합니다.
내 응용 프로그램에는 두 종류의 pdf 문서가 있습니다.
하나는 세로 방향 문서에 있고 다른 하나는 가로 문서입니다.
는 난 단지 세로보기 세로 문서를 열려면, 그리고
가로보기 만의 풍경 문서.
내가 이렇게하고 싶지 :
내 응용 프로그램 경우는 풍경이 같은 세로보기로 회전과 동일해야한다, 그래서 내 응용 프로그램이 가로보기에서 열려 있고 내가
세로 문서를 클릭하면 세로보기로 열어 가로 문서를 클릭하면
이 회전해야하며 그렇지 않은 경우 가로로만 문서를 열어야합니다.
희망 난 당신이 내가
당신의 도움이 필요 기쁘게 원하는 것을 이해 너희들은 분명히 나의 영어 희망을 용서합니다.
이여기 내 일부 코드 사전에 감사합니다
- (void)viewDidLoad
{
[super viewDidLoad];
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
if (orientation == UIInterfaceOrientationPortrait || orientation ==
UIInterfaceOrientationPortraitUpsideDown) {
NSLog(@"Portrait");
if ([orientationObject isEqualToString:@"p"]) {
//If the document is portrait
pdfScrollViewFrame = CGRectMake(-0.0, -80.0, 770.0, 1085.0);
}
else{
// If the document is landscape
pdfScrollViewFrame = CGRectMake(-0.0, -40.0, 770.0, 1130.0);
}
}
else{
NSLog(@"Landscape");
if ([orientationObject isEqualToString:@"p"]) {
//If the document is portrait
pdfScrollViewFrame = CGRectMake(65.0, -80.0, 620.0, 1110.0);
}
else{
//if the document is landscape
pdfScrollViewFrame = CGRectMake(0.0, -40.0, 740.0, 1070.0);
}
}
이 http://stackoverflow.com/ 도움이 될 : 나는 다음을 수행 할,
viewDidAppear
이후에만 잠금 회전하기 위해:이 경우 같은 뭔가를 시도 할 수 있습니다 질문/15110838/xcode-how-do-i-keep-views-portrait-mode-but-still-allow-one-view로보기 – Kassem
이것은'xcode '와 무슨 상관이 있습니까? – Popeye