The Screen1.OrientationChanged event would probably be a good place to compare Screen1 Width and Height to determine which of 2 Arrangements (one for Portrait and one for Landscape) to make Visible, and which Images to populate with your 8 Pictures.
P.S. Table Arrangements are buggier than a baby buggy. Use nested horizontal and vertical Arrangements.
Thanks ABG! But still no luck. I tried setting that on screen1.initialize. But it didn't help. To test things, I wrote up an app that has 1 button and a text box. The coding is 1 procedure ("only") and 2 "when" events: when button1.clicked do "only" and when screen1.screenorientationchanged do "only." "Only" writes the screen height, screen width and screenorientation value to the text box. Rotating my phone doesn't cause "only" to fire. (With or without the set screen1.screenorientation to "user.") The only way to get "only" to run is to click the button.
So... my question is how do I get "only" to fire when the screen is rotated?
I set up my new smartphone for the first time with AI2, and ran some tests.
I discovered a time delay before the new Height and Width were available after the Orientation Changed event.,
so I added a special purpose one shot Clock to delay the orientation test.
I needed to use Sensor as my initial Screen1.Orientation value.
Nothing yet. I downloaded/imported the aia you provided and nothing happens. I get the screen height and width at initialization, but then nothing after that.
Does it matter if I'm using an iPhone vs something else? I'm on an iPhone 11 Pro Max running IOS 14.x (when I first had this issue) and now on IOS 15.1.
I appreciate the help a TON! Sorry for being such a pain in the neck!
You posted some responses to the first thread linked below (a year ago!). I'm having similar problems now so I wanted to reach out to you. See the 2nd link for the full thread, but the short version is that when screenorientationchanged never fires. I'm starting to suspect it's because I'm on an iPhone and not an Andriod, but that's just a guess at this point.
Thanks in advance for any help/advice/thoughts you have on this.
The ScreenOrientation property has never returned the current orientation, it's always the developer-specified (desired) orientation. I think what we probably need to do is provide a CurrentOrientation property that could be checked if the layout needs to be modified. You could also compare the screen's Width/Height properties in the event handler, although I don't know off the top of my head whether at that point in time they reflect the old orientation or the new.
After reviewing the code, it does look like we are not calling the event handler when the screen orientations. It seems to me like a straightforward fix based on the documentation I've read.
Oof... What's the process to request improvements to app inventor? Recognizing / reacting to a screen orientation change on an iPhone seems like something that should happen without running a timer in the background.