How to change background image when screen rotete or screen orientation change (landscape or portrait)

I have set screen orientation to sensor mode so user can use app in both portrait or landscape mode.

So i want to use 2 different background images for landscape or portrait screen orientation .

if screen orientation is portrait background image should be portrait.jgp
or if screen orientation is landscape background image should be landscape.jpg

i was trying this but not working.

The Screen1.Screen Orientation block will return only the property set by the user, not the actual orientation of the screen. I would recommend using the Accelerometer Sensor to get the x Accel to know if the device is portrait or landscape.

1 Like