2
내가 배포 정보에 의존하지 않고 내 viewController
단지 세로 방향을 고정하려고하지만 내 다음 코드는 당신이 부모에 코드를 넣어 확인스위프트 3
override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return UIInterfaceOrientationMask.portrait
}
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return UIInterfaceOrientation.portrait
}
override func viewDidLoad() {
super.viewDidLoad()
}
왜 정보에 의존하지 않습니까? –
코드를 복사하여 붙여 넣기 만하면 viewController를 * portrait * 모드로 잠급니다. 오버라이드 var supportedInterfaceOrientations : UIInterfaceOrientationMask {return UIInterfaceOrientationMask.portrait}'로 충분해야합니다. . –
@Carlo plz 여기를 살펴보십시오. - https://stackoverflow.com/questions/31758706/how-to-force-or-disable-interface-orientation-for-some-but-not-all-uiviewcontrol/31801804# 31801804 –