0

我在两个方向(在 iPad 上)显示我的应用程序时遇到问题。有时我的应用程序卡住了,所有显示对象都在右上角(仅当用户以纵向模式旋转应用程序时才会发生这种情况),否则应用程序很好。我被困在这一点上。我该如何解决这个问题?这是我的代码:

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 )

任何帮助将不胜感激?

谢谢。

4

1 回答 1

1

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................ :)

于 2013-08-23T05:43:53.800 回答