Hello, I have an error, my scenario is as follows: I have a home screen on which I press a button and it opens a new screen, both screens are in landscape mode. The error occurs when the button on the first screen is clicked, then the second screen opens but it starts in portrait mode and after a few seconds it changes to landscape mode. How can I do so this orientation change does not happen. By the way thank you and happy holidays to all ...https://community.appinventor.mit.edu/uploads/default/original/2X/5/5917b1658b50e862084644395ba3b437c823cbbd.mp4
Following this guidance may help to overcome your issue?
- Before starting to create another screen, first you should think about is it really necessary?
- See also Building apps with many screens and SteveJG's post about advantages/disadvantages, because in only one screen you also can use vertical arrangements to simulate different screens, just set the arrangements to visible = true/false as needed...
- See also Martyn_HK's example about how to use Tabs in App Inventor and another example from Cyd. and my Tabbed Screens Demo
If you decided to use different screens, then you should switch them correctly, else you will run out of memory after a while...
The recommended method of switching screens in App Inventor
Till now never used landscape orientation but now I'm developing a two screen app and same thing happens to me. Below is a simple test aia . Each screen contains only a buton to switch from one screen to another
landscape.aia (3.0 KB)
Both screens orientation is set to landscape and when changing from one screen to another for a split second orientation changes to portrait
Is there a way to fix it ? Am I doing something wrong ? Any help appreciated
Does it happen with a compiled app (apk) as well ?
Yes same thing happens and looks ugly
Actually the video is from the compiled apk
looks ugly
If I start the app with companion holding my device in a landscape position, then there is no switching. If I then rotate the phone to portrait i then get the switching problem. once back in landscape position problem goes away.
Tested on Google Pixel 4a Android 11
Xiaomi Mi A1 android 9 , Hold it portrait (since a user doesn't know orientation) Starts landscape , turn it and hold it in landscape position , when button pressed for a split second orientation changes to portrait and then to landscape
Can't find a fix for this, can only offer my previous advice which is to use virtual screens. Perhaps someone else can advise....
After trying I found a work around that doesn't seem so ugly. I use a clock with time interval set to 250 and my layout is hidden. When clock.timer reaches 250 layout is set to visible and I do not see that ugly portrait-landscape change
Well done!
This is what i tried to describe here with openscreenanimations, but then i couldnt make a video from it. It is depends on the phone orientation and orientation sensor on phone locked or not, and the screen set landscape or sensor mode. Virtual screen is not helpinf if you want openanimations. Or you have to make your own animated virtual screen.