开发者

How can I programmatically know which interface orientaton I am in when the application loads?

开发者 https://www.devze.com 2022-12-27 05:48 出处:网络
Using some of the methods, I am able to check the orientations to which I am rotating开发者_如何学JAVA my device. But how can I know the orientation in which I am in when the app is loaded? I want to

Using some of the methods, I am able to check the orientations to which I am rotating开发者_如何学JAVA my device. But how can I know the orientation in which I am in when the app is loaded? I want to write the code to rearrange the views in the viewDidLoad method by checking the way my orientation is in?


UIDeviceOrientation myOrientation = [[UIDevice currentDevice] orientation];


You could also use something similar to below in the ViewDidLoad/ViewWillAppear methods.

if(UIInterfaceOrientationIsLandscape(self.interfaceOrientation)){
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号