0
votes

I am getting an issue while displaying my app in both orientation(on iPad). Some times my app is stuck and all the display object go to right at top corner(It happens in only when user rotate the app in portrait mode) other wise the app is fine. I am stuck at this point. How do i solve this? Here is my code:

function onOrientationChange( event )

   if system.orientation == "portrait" 
   or system.orientation == "portraitUpsideDown" then

    _W = 768
    _H = 1024
    _X = _W/2
    _Y = _H/2

  else

    _W = 1024
    _H = 768
    _X = _W/2
    _Y = _H/2

  end   

end 

Runtime:addEventListener( "orientation", onOrientationChange )

Any help will be appreciated?

Thannks.

1

1 Answers

1
votes

I think you can solve it by removing the above code from your project, and just adding the following in your build.settings file (since you need orientations in two portrait modes):

orientation =
  {
    default = "portrait",
    supported =
      {
        "portrait", "portraitUpsideDown"
      },
  },

Keep Coding................ :)