How to disable landscape mode?

Simonxman

Member
Hi guys i dont wanna my app to have landscape mode, if the phone rotate the app is still the same without any changes, is this possible if yes,how?

Thanks !!
 
Phone library:

From the help:

SetScreenOrientation

Method

Changes the current activity orientation. This method cannot be called from a service module.
Orientation: -1 for unspecified, 0 for landscape and 1 for portrait.

Returns : Void

SetScreenOrientation(Orientation As Int)


Best regards.
 
Upvote 0
Klaus's method is the way to go:

Load the phone library

Dim Phone as Phone
Phone.SetScreenOrientation(1)
 
Upvote 0
i saw a lot of exemple to set orientation with the phone librarie...

but i need to know the what is current orientation ? (if it's landscape or portrait)
 
Upvote 0
It's important to say, that you need this in a service ("Live Wallpaper" is a service). But, it's not possible to set the orientation on a service with a switch or the manifest.

You must draw your picture/background corresponding to portrait when landscape is detected...

Sorry, it's not a simple thing to do this on a service... ;-)

Regards,
trebun
 
Upvote 0
Beginner's Guide chapter 17.25 Detect screen orientation.
Or in the search field 'detect screen orientation' the first result gives you the solution !
Code: Copy
If Activity.Width > Activity.Height Then
   Orientation = "Landscape"
Else
   Orientation = "Portait"
End If
Best regards.
 
Upvote 0
Back
Top