screen orientation?

Ricky D

Well-Known Member
Licensed User
Longtime User
Ok, I now have my head sorted out with the dual layouts I will be using.

Now I would like to know how do I detect what orientation the screen is in when certain bits of code get executed.

I'd like to do something like

B4X:
If orientation="Potrait" Then
    TabHost1.AddTab("Page 1")
    TabHost1.AddTab("Page 2")
Else If orientation="Landscape" Then
    Tabhost1.AddTab("Page 1")
    TabHost1.AddTab("Page 2")
    TabHost1.AddTab("Page 3")
End If

how do I detect what orientation is at any given moment?

I've tried looking at Phone but no joy.

Can anyone help?

There will be a few places where I need to detect which way the screen is oriented.

regards, Ricky
 

Ricky D

Well-Known Member
Licensed User
Longtime User
:sign0142:

Thanks Margret.

regards, Ricky
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…