UIDeviceOrientation
डिवाइस के भौतिक अभिविन्यास को संदर्भित करता है जबकि UIInterfaceOrientation
उपयोगकर्ता इंटरफ़ेस के अभिविन्यास को संदर्भित करता है। जब आप अपने विधि
[self orientationChanged:interfaceOrientation];
आप सबसे अधिक संभावना यह एक UIDeviceOrientation
गुजर रहे हैं जब आप, विधि के अनुसार, एक UIInterfaceOrientation
का उपयोग करना चाहिए कहते हैं।
बस इस मुद्दे पर थोड़ा विस्तार करने के लिए, UIDeviceOrientation
वर्ग की संपत्ति है, और इन संभावित मान देखते हैं:
UIDeviceOrientationUnknown
- निर्धारित नहीं किया जा सकता है
UIDeviceOrientationPortrait
- होम बटन नीचे की ओर
UIDeviceOrientationPortraitUpsideDown
- होम
UIDeviceOrientationLandscapeLeft
को ऊपर की ओर बटन - होम बटन का सामना करना पड़ सही
UIDeviceOrientationLandscapeRight
- होम बटन सामना
UIDeviceOrientationFaceUp
छोड़ दिया - डिवाइस
UIDeviceOrientationFaceDown
को ऊपर की ओर सपाट है, स्क्रीन के साथ - डिवाइस सपाट है, स्क्रीन
के रूप में नीचे का सामना करना पड़ के साथ UIInterfaceOrientation
के लिए, यह UIApplication
की एक संपत्ति है और इसमें केवल 4 संभावनाएं हैं जो स्टेटस बार के अभिविन्यास से मेल खाते हैं:
UIInterfaceOrientationPortrait = UIDeviceOrientationPortrait,
UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
UIInterfaceOrientationLandscapeLeft = UIDeviceOrientationLandscapeRight,
UIInterfaceOrientationLandscapeRight = UIDeviceOrientationLandscapeLeft
UIDeviceOrientation
पाने के लिए, आप का उपयोग
[[UIDevice currentDevice] orientation]
और UIInterfaceOrientation
प्राप्त करने के लिए, आप का उपयोग
[[UIApplication sharedApplication] statusBarOrientation]
इस के लिए धन्यवाद कहने के लिए भूल। तो ... धन्यवाद –
बस इस समस्या में फिर से भाग गया और आपने मुझे फिर से बचाया। काश मैं तुम्हें दो बार ऊपर उठा सकता हूं। –