iOS Question Change Orientation

cloner7801

Active Member
Licensed User
Longtime User
I want to change Orientation when click on button
I am using this code:

B4X:
Sub SetOrientation(landscape As Boolean)

Dim no AsNativeObject

Dim value As Int

If landscape Then value = 4 Else value = 1

no.Initialize("UIDevice").RunMethod("currentDevice", Null).SetField("orientation", value)

EndSub

it work correctly ! but I want my application always portrait ! but when click on button it change to landscape ! but it didnt work..
How can I create this?

Thanks
 
Top