Force Layout Orientation

Pelky

Active Member
Licensed User
Longtime User
I have a app with a menu.. One choice is to show a report of activities (which could be a lot of data) and would like to programatically force 'landscape' for this choice only.
I have looked at the beginners guide and it only shows changing the entire project to either or all orientations.

Thank you all for previous assistance - it is great to have this wealth of information and experience available to us newbies...
 

Kevin

Well-Known Member
Licensed User
Longtime User
You will need to add the "phone" library to your project, then the following code:

B4X:
Sub Process_Globals
    Dim phone1 As Phone
End Sub

... and then when you want to force landscape.......

B4X:
Phone1.SetScreenOrientation (0)

... to restore to any/automatic orientation:

B4X:
Phone1.SetScreenOrientation (-1)
 
Upvote 0

Pelky

Active Member
Licensed User
Longtime User
Guys Thank you so much... I did see the phone thing but didnt know that is was a library....
as always Your assistance is much appreciated
 
Upvote 0
Top