2013-10-24 1 views

ответ

0

Ориентации устройств действительно целые. То, что вы можете сделать, это локальная переменная, которую вы устанавливаете на текущую ориентацию при нажатии кнопки, а затем возвращаете только эту ориентацию из методов ориентации. Если это целое не установлено, верните ориентацию устройства. Также обратите внимание, что shouldAutorotateToInterfaceOrientation устарел в iOS 6.0. Из документов:

shouldAutorotateToInterfaceOrientation : (Deprecated in iOS 6.0. Override the supportedInterfaceOrientations and preferredInterfaceOrientationForPresentation methods instead.) 

EDIT: Вот ссылка на UIInterfaceOrientation.

ЬурейеЕ перечисление: NSInteger { UIInterfaceOrientationPortrait = UIDeviceOrientationPortrait, UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown, UIInterfaceOrientationLandscapeLeft = UIDeviceOrientationLandscapeRight, UIInterfaceOrientationLandscapeRight = UIDeviceOrientationLandscapeLeft } UIInterfaceOrientation;