What is the correct way to detect Portrait versus Landscape?

Following up on Basic Canvas question from 18 months ago... it appears that the Screen1.ScreenOrientationChanged event is generated significantly before (100s of milliseconds) Screen1.Width and Screen1.Height are updated.

As the subject asks, 'What is the correct way to detect Screen1 Portrait versus Landscape?'

Thanks.

— dcp

Probably

Screen1.ScreenOrientationChanged

but it depends on what you need from that!

1 Like

If screen width > height
Then landscape
Else portrait

Taifun

3 Likes

If screen width > height
Then landscape
Else portrait

Reorient | mit-app-inventor Um... except not.

I guess you can use this block
image
from this extension

yes, this is not immediately.... therefore just use a clock to get some delay as that article describes...
Taifun

https://community.appinventor.mit.edu/t/screen-orientation/42415/5?u=anke

Sorry the link is from the power user forum (thanks Taifun for the hint).