본문 바로가기

옛글/아이폰 프로그래밍

[iOS프로그래밍] 가로모드, 세로모드 고정시키기

반응형

1. 세로 고정
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
  return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation  ==UIInterfaceOrientationPortraitUpsideDown);
}

2. 가로 고정
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
  return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft|| interfaceOrientation  ==UIInterfaceOrientationLandscapeRight);
}









반응형