orientation weirdness
Posted: Mon Jun 20, 2011 5:09 pm
Hello: I am experiencing some odd issues with orientation control:
I use "on orientationChanged" to reconfigure elements on my page to fit either Portrait or Landscape. It all works fine on the simulator, but on the iPhone, sometimes (this is inconsistent), when the device is in portrait orientation, my app will display as if it were landscape (with the card beelding off the right hand side of the device, and a blank space below). Then it will start 'flickering' between correct portrait orientation and the incorrect landscape orientation.
on preopencard
if the environment is "mobile" then
put "portrait,portrait upside down,landscape left,landscape right" into theallowed
iphoneSetAllowedOrientations theallowed
end if
focus on nothing
send resizestack
end preopencard
on orientationChanged
send "resizestack" to me in 0 millisecs
end orientationChanged
on resizestack
put "portrait" into currentorient
if the environment is "mobile" then
put iPhoneDeviceOrientation() into currentorient
end if
if currentorient is "portrait" or currentorient is "portrait upside down" then
--move all the stuff to portrait orientation
set the loc of group navbuttons to 326,874
set the rect of group theplotdaily to 39,533,266,821
else
--move all the stuff to landscape orientation
set the loc of group navbuttons to 504,554
set the rect of group theplotdaily to 636,176,780,466
end if
I use "on orientationChanged" to reconfigure elements on my page to fit either Portrait or Landscape. It all works fine on the simulator, but on the iPhone, sometimes (this is inconsistent), when the device is in portrait orientation, my app will display as if it were landscape (with the card beelding off the right hand side of the device, and a blank space below). Then it will start 'flickering' between correct portrait orientation and the incorrect landscape orientation.
on preopencard
if the environment is "mobile" then
put "portrait,portrait upside down,landscape left,landscape right" into theallowed
iphoneSetAllowedOrientations theallowed
end if
focus on nothing
send resizestack
end preopencard
on orientationChanged
send "resizestack" to me in 0 millisecs
end orientationChanged
on resizestack
put "portrait" into currentorient
if the environment is "mobile" then
put iPhoneDeviceOrientation() into currentorient
end if
if currentorient is "portrait" or currentorient is "portrait upside down" then
--move all the stuff to portrait orientation
set the loc of group navbuttons to 326,874
set the rect of group theplotdaily to 39,533,266,821
else
--move all the stuff to landscape orientation
set the loc of group navbuttons to 504,554
set the rect of group theplotdaily to 636,176,780,466
end if