iOS에서 새로운 기능이며 회전 관련 문제가 있습니다. 단일 뷰 컨트롤러 회전을 세로 방향으로 고정하면됩니다. 이 코드를 사용하고 있습니다.대물 렌즈 C에서 세로의 회전 방향을 고정하는 방법
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:NO];
[UIView setAnimationsEnabled:NO];
NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight];
[[UIDevice currentDevice] setValue:value forKey:@"orientation"];
}
가로로는 잘되지만 세로로는 작동하지 않습니다. 어떻게 초상화로 사용할 수 있습니까? 이런 초상화 기법을 시도했습니다.
- UIInterfaceOrientationMaskPortrait
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationMaskPortraitUpsideDown 그러나 나를 위해 전혀 작동합니다. 미리 감사드립니다.
이 시도 세로로
가 // 잠금 방향 http://stackoverflow.com/questions/26357162/how- to-force-view-controller-orientation-in-ios-8 –
@UmairAfzal 이는 내가 사용했던 것과 동일합니다. – Muju
iOS 버전이 무엇입니까? –