Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
いくつかの方法を使用して、デバイスを回転させている方向を確認できます。しかし、アプリがロードされたときの自分の向きをどのように知ることができますか?向きを確認して、viewDidLoadメソッドのビューを再配置するコードを記述したいですか?
UIDeviceOrientation myOrientation = [[UIDevice currentDevice] orientation];
ViewDidLoad/ViewWillAppearメソッドで以下のようなものを使用することもできます。
if(UIInterfaceOrientationIsLandscape(self.interfaceOrientation)){ }