LandScape Orientation issue with iOS 8 in Unity
Asked Answered
M

2

2

I am making game in Unity 4.5.0 with landscape mode. but i have screen orientation problem while building in iphone with ios 8.

My game is not opening in landscape mode while my device set with landscape orientation.

I have set all setting in player setting.

enter image description here

In xcode 6.0 also i set orientation.

enter image description here

Then also my game is not opening with Landscape mode. what can be the problem ? I don't find any any solution for that.

Please guys help me to solve this bug. Thanks.

Edit :

I changed default orientation to "Autorotation" in that i select Landscape left. the result i get is like this :

enter image description here

Moscow answered 27/9, 2014 at 6:34 Comment(10)
I had the same thing. It was fixed when I regenerated the xcode project.Wobble
@Wobble hmm. but i am still facing same problem. Actually i am using Google Admob Ad..is it creating issue ?Moscow
Im using Unity 4.5.4f1. I know there were issues before with this. I have no experience with google admod ads, sorry.Wobble
Btw: I have the following Player settings: Autorotation, and then Landscape Right/Landscape Left selected.Wobble
@Wobble i set settings as u said. but result is not coming. i updated my question.Moscow
Ok: try Screen.autorotateToLandscapeRight = true; in an update. This should force the issue.Wobble
PS: screen looks greatWobble
I tried using xcode5.1.1. working perfect.Moscow
Hi, i have the same issue, do you have any progress? I'm using unity 3.5.7 + xcode6Avian
I think there is problem with xcode6. you try to build with lower version of xcode. this will solve ur problem. @AvianMoscow
C
0

I got the same problem, got here and it didn't help. I found the solution, and I'm posting here in case anyone else is having the same issue.

It is a problem with Unity3D v4.5.3 or lower versions, unless you have this patch: http://forum.unity3d.com/threads/unity-patch-releases.246198/#post-1734940

One of the fixes there is: (none) - iOS: Fixed startup orientation handling on iOS8.

So, that answers the question to others that gete here like me.

In short: just download the latest version. (v4.5.5 as today), migrate your project, use Build (instead of build and run) and test.

Hope it helps other people.

Cluck answered 15/10, 2014 at 20:0 Comment(0)
C
0

goto iPhone_OrientationSupport.mm file and remove "return screenRect;" from ContentRectForOrientation method. Line number 18

CGRect ContentRectForOrientation(ScreenOrientation orient)
   {
     CGRect screenRect = [[UIScreen mainScreen] bounds];
      switch(orient)
        {
         case portrait:
         case portraitUpsideDown:
         case landscapeLeft:
         case landscapeRight:
        return CGRectMake(screenRect.origin.y, screenRect.origin.x,    screenRect.size.height, screenRect.size.width);
    default:
        return screenRect;
       }
  return screenRect;
}
Consonant answered 27/5, 2015 at 5:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.