orientation weirdness
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 349
- Joined: Tue Oct 28, 2008 1:23 am
- Contact:
orientation weirdness
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
-
- Posts: 349
- Joined: Tue Oct 28, 2008 1:23 am
- Contact:
Re: orientation weirdness
ok - I read my post again, and realized that maybe I didn't need "on orientationchanged", so I removed it and it solved the issue.
However, when I START the iOS application, it still appears in the wrong orientation - even when I FORCE it to draw a portrait screen ie: on opencard, draw all the stuff in portrait layout). ANy idea why? Its almost as if on START, the device 'thinks' it is in landspace orientation when it is actually in Potrait. Even if I force the page to be drawn as portrait, it still ends up getting a resizestack message saying that the device is in landscape orientation.
Thanks
However, when I START the iOS application, it still appears in the wrong orientation - even when I FORCE it to draw a portrait screen ie: on opencard, draw all the stuff in portrait layout). ANy idea why? Its almost as if on START, the device 'thinks' it is in landspace orientation when it is actually in Potrait. Even if I force the page to be drawn as portrait, it still ends up getting a resizestack message saying that the device is in landscape orientation.
Thanks
Re: orientation weirdness
Right, the orientationChanged message is sent before the actual change occurs, so if you position objects in response to that message it will use the existing orientation, not the new one. The resizeStack message is sent after the device has re-oriented, and that's the one to use for new placement of objects.adventuresofgreg wrote:ok - I read my post again, and realized that maybe I didn't need "on orientationchanged", so I removed it and it solved the issue.
The app should start up in the orientation you've set in the Standalone Settings pane using the "Initial orientation" popdown menu. Is that set to one of the portrait choices?However, when I START the iOS application, it still appears in the wrong orientation - even when I FORCE it to draw a portrait screen ie: on opencard, draw all the stuff in portrait layout). ANy idea why? Its almost as if on START, the device 'thinks' it is in landspace orientation when it is actually in Potrait. Even if I force the page to be drawn as portrait, it still ends up getting a resizestack message saying that the device is in landscape orientation.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 349
- Joined: Tue Oct 28, 2008 1:23 am
- Contact:
Re: orientation weirdness
YA!! Thanks. I didn't know there was initial orientation setting. It was set to Portrait, but I didn't have the other supported Interface Orientations selected - which is weird because they should have been working at all - yet they were. ??
-
- Posts: 349
- Joined: Tue Oct 28, 2008 1:23 am
- Contact:
Re: orientation weirdness
This is still a problem. I have the initial orientation set to Portrait, but when I launch, my first screen always shows up oriented as landscape IN a portrait orientation of the device. Any ideas?
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 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
else
--move all the stuff to 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 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
else
--move all the stuff to landscape orientation
Re: orientation weirdness
Move the stuff in your preopencard handler into a preOpenStack handler. You need to set orientations before anything else runs.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com