iOS Question Question about Display orientation

  • Thread starter Thread starter Deleted member 103
  • Start date Start date
  • Similar Threads Similar Threads Similar Threads
D

Deleted member 103

Guest
Hi,

I want the iPhone from 5 inches (iPhone 6+) the same orientation as an iPad, how can I make it?
With this code does not go. :(

Code: Copy
    If IsPadDevice Then
        #iPadOrientations: LandscapeLeft, LandscapeRight
        #iPhoneOrientations: LandscapeLeft, LandscapeRight
        Page1.RootPanel.LoadLayout("frmMainIpad")
    Else
        #iPhoneOrientations: Portrait
        Page1.RootPanel.LoadLayout("frmMainIphone")
    End If
Code: Copy
Public Sub IsPadDevice As Boolean
    If Main.App.iPadDevice Or GetDeviceLayoutValues.DeviceApproximateScreenSize > 5 Then
        Return True
    Else
        Return False
    End If
End Sub
 
you could set the attributes to Landscape only and when you start your app you could check if DeviceApproximateScreenSize < 5 and change the orientation programmatically

Code: Copy
Sub SetOrientation(landscape As Boolean)
   Dim no As NativeObject
   Dim value As Int
   If landscape Then value = 4 Else value = 1
   no.Initialize("UIDevice").RunMethod("currentDevice", Null).SetField("orientation", value)
End Sub

(code found here: https://www.b4x.com/android/forum/t...-view-in-portrait-only-app.51391/#post-321845)
 
Upvote 0
Thank you Ilan! :)
I had searched, before my request, for this info, unfortunately without success.
 
Upvote 0
Back
Top