D Deleted member 103 Guest Jun 5, 2017 #1 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
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
Erel B4X founder Staff member Licensed User Longtime User Jun 5, 2017 #2 It is not possible. The attributes are used during compilation to create the PList file. Upvote 0
D Deleted member 103 Guest Jun 5, 2017 #3 Erel said: It is not possible. The attributes are used during compilation to create the PList file. Click to expand... Apple Upvote 0
Erel said: It is not possible. The attributes are used during compilation to create the PList file. Click to expand... Apple
ilan Expert Licensed User Longtime User Jun 5, 2017 #4 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
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)
D Deleted member 103 Guest Jun 6, 2017 #5 Thank you Ilan! I had searched, before my request, for this info, unfortunately without success. Upvote 0