This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Wouter Walmink
Posted Jun 16 - Read on Facebook

Hey framers, I expected (Framer.Device.)Screen.width to take the phone's orientation into account. So for e.g. the iPhone6, it Screen.width would return 1334 when the screen is in landscape mode at the moment the value is read. Instead, it gives me 750.

Is this expected behaviour and, if yes, is there any better solution to this than storing my own screenWidth and screenHeight that is updated whenever the phone orientation changes?


Benjamin Den Boer

Hey Wouter Walmink — The Screen object does just that. Try Screen.width / Screen.height / Screen.size :-)

Wouter Walmink

Hey, that's strange... I would swear that wasn't working the first time around... But now it is :) Thanks

Wouter Walmink

Kostantinos Frantzis ↑

Wouter Walmink

Update: turns out in some way, my project got corrupted. Screen.width gives the right value in another new project, but in the project I was having trouble, it gives the wrong value, even if I remove all other code.

Read the entire post on Facebook