Screen Rotation Problem

I’ve two screens for my app, one when the app is in portrait and one for landscape. I’m not able to change the screens, what should I do?

Use open another screen block.

put a floating view button when screen on landscape mode…
( set button fuction to change screen on potrait mode).

how do I do that with which sensor?

Use this block in both your screens to detect change of screen orientation! (Available in Screen Component)

Screenshot_20200928-012922~2

Then use open another screen block to open the 2nd screen.
Screenshot_20200928-013308~2
Pls. Note: in second screeen, instead of “open another screen”, close that screen to view screen 1.

There is an error, it says ‘This is a duplicate event handler for this component’

The error says all, you have added twice the same block. Press on red warnings to find it

image

3 Likes

Welcome them to our community!

Hey, this is just working once. Like when I move my phone from portrait to landscape, but not back from landscape to portrait.

:point_down:t2:

If that doesnt work please share the image of these blocks you used in both screens.

hey this is not working, if I go directly from landscape to reverse landscape/portrait to reverse portrait, it creates problems

I did a mistake at my end, thank a lot for your help

Happy to hear it :+1:t2: Then mark your solution and close this topic

We are happy to know you solved your problem, but it would be kind of you if you explained what was your problem,so any other user had the same issue can find the solution :wink:

Yes that’s absolutely right :raised_hands:t2:

1 Like

hey this is not working, if I go directly from landscape to reverse landscape/portrait to reverse portrait, it creates problems

So the problem isn’t yet solved :thinking:

:point_up_2::point_up_2::point_up_2: Otherwise there is no use in telling what to do without us knowing the problem in your code. So if you want the problem to be resolved share the blocks or the aia

It’s always the same problem:
Please describe exactly what you expect (what should happen).

  1. open Screen1 (→ portrait / landscape?)

So what is the goal?

See also here:

  1. the first screen is portrait.
  2. the second is landscape.

If any person rotates his phone the application should move between

portrait to landscape/
portrait to reverse landscape/
portrait to reverse portrait/

landscape to portrait/
landscape to reverse portrait/
landscape to reverse landscape/

reverse portrait to portrait/
reverse portrait to reverse landscape/
reverse portrait to reverse portrait/

reverse landscape to portrait/
reverse landscape to landscape/
reverse landscape to reverse portrait/

Then the screen should also change to the same orientation

Screen 1(portrait) is both for portrait and reverse portrait
Screen 2(landscape) is both for landscape and reverse landscape