mobileorientation lags??

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jameshale
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 474
Joined: Thu Sep 04, 2008 6:23 am
Location: Melbourne Australia

mobileorientation lags??

Post by jameshale » Tue Oct 10, 2023 2:20 am

Hi

I am trying to adjust controls on my iOS app and need to get the width of the stack. Seems simple.
on a test stack I put the following code:

Code: Select all

on orientationchanged
 put the width of this stack & "   " & mobileOrientation() into fld "f1"
end orientationchanged
   
The tested in the iPhone simulator.
As I changed the orientation the values changed.
The value for screen width seems fine.
The value for the orientation of the other hand did not.
It reported the previous orientation.
i.e. When in portrait and I click the button to change the orientation the answer field shows 844 portrait.
of course it is currently in landscape. So orientation one step behind.
click it again. -> 844 landscape left ---BOTH WRONG as it is now in portrait upside down, but as this is a not allowed orientation I will ignore it.
click again.--> 844 portrait upside down ---- width right (now) but orientation one step behind
click ain.--> 390 landscape right --- width right (now) but orientation one step behind

has anyone one else seen this and if they have is there a solution? to get the correct current orientation?

jameshale
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 474
Joined: Thu Sep 04, 2008 6:23 am
Location: Melbourne Australia

Re: mobileorientation lags??

Post by jameshale » Tue Oct 10, 2023 3:07 am

SOLVED.

I should have used mobileDeviceOrientation() not mobileOrientation()

jameshale
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 474
Joined: Thu Sep 04, 2008 6:23 am
Location: Melbourne Australia

Re: mobileorientation lags??

Post by jameshale » Tue Oct 10, 2023 6:40 am


Post Reply

Return to “iOS Deployment”