Jump to content

Recommended Posts

Posted

If yes, can you try this approach ?!:

 

MainForm -> Script:

window.addEventListener('orientationchange', function(event){
    switch(window.orientation){
        case -90: case 90:
            // landscape
            alert("landscape");
            break;
        default:
            // portrait
            alert("portrait");
    }
})
Posted

Hi,

 

How about for mobile ?

 

MainmForm -> ClientEvents -> ExtEvents -> window.orientationchange fn:

function window.orientationchange(eOpts)
{

}

Best regards,

  • 6 years later...
Posted
On 6/22/2017 at 3:34 AM, Sherzod said:

Hi,

 

 

MainmForm -> ClientEvents -> ExtEvents -> window.orientationchange fn:

function window.orientationchange(eOpts)
{

}

Best regards,

How can I lock the screen orientation?

I've already tried some options but I can't be successful.

Could you give any tips?

Posted
1 hour ago, mikromundo said:

Thanks for the feedback, but I've already done all these tests.

I can do it but only when it's in fullscreen.

So you dont want to be in fullscreen ?

Posted
14 hours ago, mikromundo said:

How can I lock the screen orientation?

Are you using a mobile browser?

14 hours ago, mikromundo said:

I've already tried some options but I can't be successful.

What exactly did you try?

 

In any case, I think at the moment this is impossible if you use a mobile browser in the usual sense.

Posted

Yes, accessing via cell phone.

It was really a question... whether it would be possible to do it without being in fullscreen.

But I understand that it only works like that.

thank you all !!!

  • 4 weeks later...
Posted

Hello my friend, thank you.

so...I created a specific function for orientation / platform detection...but the question above wouldn't be that.

It's really change.

is to force the orientation and as mentioned, it only works on "full screen".

Posted

Yeah, it's totally possible to detect screen orientation in a UniGui app on a smartphone. You can use JavaScript to check the window.orientation property, and then take action based on the value (0 for portrait, 90 for landscape, -90 for landscape in the other direction).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...