Reputation: 429
I am developing an app, in which i have X object
and when device orientation
get changed, the object should get changed in same direction
.
for example, I have an X Object.
Y
|
|
|
|
|
|___________X
Want to move X object
in same direction
as device Orientation
get changed
?
I am not getting how to do it ?
Please suggest me , How could i do it?
Thanks.
Upvotes: 0
Views: 75
Reputation: 1099
You can use viewDidLayouSubviews, see a sample:
-(void)viewDidLayoutSubviews{
[super viewDidLayoutSubviews];
if([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft)
{
....
}
else if([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeRight)
{
.....
}
else ...
}
Upvotes: 1