我聽說使用[UIDevice setOrientation:]
可能是Appstore中應用程序拒絕的原因。有沒有關於它的證明信息?方法[UIDevice setOrientation:] - 它仍然被拒絕?
3
A
回答
5
這是正確的 - 使用此私有方法時,您的應用將被拒絕。我們已經做到了,我們已經被拒絕了(並且我們找到了解決方法)。
1
目前(iOS 5中)的定義是:
@property (nonatomic, readonly) UIDeviceOrientation orientation
所以即使有是一個setter(setOrientation:
或.orientation =
),這將是私有API作爲官方文件說,它不存在。而使用私有API會讓你被拒絕。
1
如果沒有記錄方法,請不要使用它。使用未記錄的方法將導致拒絕。這與檢查Apple文檔一樣簡單。
在這種情況下,文檔狀態:
@property (nonatomic, readonly) UIDeviceOrientation orientation
2
的方法是存在的,給你關於設備的物理方位信息,無編碼的數量將改變這種物理方向。它是根據陀螺儀/加速度計設置的,它告訴設備它的方向是沒有意義的。
如果你想改變界面的方向,那麼你應該看看的UIViewController回調,允許您定義:
interfaceOrientation property
– shouldAutorotateToInterfaceOrientation:
+ attemptRotationToDeviceOrientation
– rotatingHeaderView
– rotatingFooterView
– willRotateToInterfaceOrientation:duration:
– willAnimateRotationToInterfaceOrientation:duration:
– didRotateFromInterfaceOrientation:
-1
使用此:
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { 回報UIInterfaceOrientationPortrait; }
+0
這將是很好的知道*爲什麼*應該使用這個 – anatolyg
相關問題
- 1. 權限被拒絕仍然被添加到.on()監聽器
- 2. wget拒絕仍然下載文件
- 3. CSRF標籤仍然拒絕Twilio請求
- 4. Drupal:訪問被拒絕觸發,但我仍然得到內容
- 5. 量角器:已解決的承諾仍然被拒絕
- 6. 不要備份到iCloud,但仍然被拒絕
- 7. 權限甚至在chmod後仍然被拒絕777
- 8. 權限被拒絕(publickey)我仍然收到錯誤
- 9. Java Kerberos認證似乎可行,仍然被拒絕
- 10. 有什麼辦法可以讓UIDevice setOrientation警告消失?
- 11. 權限被拒絕調用方法Location.toString
- 12. 權限被拒絕調用方法HTMLAnchorElement.focus
- 13. Powershell - WriteAllLines方法 - '訪問被拒絕'
- 14. 突然訪問被拒絕消息
- 15. 儘管RabbitMQ被拒絕或被確認,但它仍然會堆疊不含郵件的郵件
- 16. 在C#中創建文件夾,應用權限,但訪問仍然被拒絕?
- 17. machine.config'被拒絕
- 18. 碼頭運行你好,世界仍然失敗,權限被拒絕
- 19. setOrientation problem
- 20. Freeswitch「mod_verto」:無效方法,缺少方法或權限被拒絕
- 21. Inetpub -acces被拒絕?
- 22. 恢復.ssh/authorized_keys文件,但仍然獲得權限被拒絕(公鑰)消息
- 23. Heroku - 添加SSH公鑰並仍然獲得權限被拒絕(publickey)錯誤
- 24. 被策略拒絕
- 25. iTunes Connect - 被拒絕
- 26. 訪問被拒絕
- 27. 訪問被拒絕
- 28. 訪問被拒絕...?
- 29. Red5 NetConnection被拒絕
- 30. 權限被拒絕
任何建議如何設置設備方向,而不會拒絕應用程序? –
@ПавелОганесян:沒有,你不應該改變方向,因爲這將是意想不到的行爲。但是,您可以限制您的應用或當前活動的UIViewController可以旋轉到的方向。請參閱[文檔](http://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instm/UIViewController/shouldAutorotateToInterfaceOrientation :)。 – DarkDust
@darkDust我已經知道了 - '(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation',它的理解和使用相當簡單。我的問題是如何在導航堆棧中的某些視圖在別人修復時進行旋轉。有些控制器只是阻止他人的旋轉而不考慮其設置。 :)也許,我應該創建另一個問題並在那裏討論它。 –