Lary Yenta Member Licensed User Longtime User May 6, 2015 #1 One of the modules in my project is a graph, how can I "force" the graph into landscape mode? I have been looking but I can't find it anywhere. Thanks in advance, lary
One of the modules in my project is a graph, how can I "force" the graph into landscape mode? I have been looking but I can't find it anywhere. Thanks in advance, lary
eurojam Well-Known Member Licensed User Longtime User May 6, 2015 #2 You can force the activity, which shows your graph, to go into landscape mode using the phone lib: http://www.b4x.com/android/help/phone.html#phone_setscreenorientation Upvote 0
You can force the activity, which shows your graph, to go into landscape mode using the phone lib: http://www.b4x.com/android/help/phone.html#phone_setscreenorientation
DonManfred Expert Licensed User Longtime User May 6, 2015 #3 Lary Yenta said: the graph into landscape mode Click to expand... To do it by code @eurojam already told you how. But you can also do it with the manifesteditor Add one line for each activity you want to run in a specific orientation Code: SetActivityAttribute(orderdetails,android:screenOrientation, "sensorLandscape") replace the orderdetails with the activityname Upvote 0
Lary Yenta said: the graph into landscape mode Click to expand... To do it by code @eurojam already told you how. But you can also do it with the manifesteditor Add one line for each activity you want to run in a specific orientation Code: SetActivityAttribute(orderdetails,android:screenOrientation, "sensorLandscape") replace the orderdetails with the activityname
Lary Yenta Member Licensed User Longtime User May 7, 2015 #4 Hey eurojam and DonManfred, I used the manifest method with no issues at all, Thanks guys!!!! Lary Upvote 0
G gz7tnn Member Licensed User Longtime User Oct 27, 2015 #5 I realize this is a older post but I have tried the Manifest approach to force screen orientation to sensorLandscape but my app will not "compile and run". It does a Test Compile without any problem. I am on B4A V2.71 with Core 2.71 and using Phone lib 2.10 When I add the following to the Manifest: SetActivityAttribute(Main,android:screenOrientation, "sensorLandscape") I get the following error when compiling: Parsing code. 0.02 Compiling code. 0.13 Compiling layouts code. 0.00 Generating R File. Error AndroidManifest.xml:17: error: Error: String types Not allowed (at 'screenOrientation' with value 'sensorLandscape'). I can however obtain the correct sensor landscape rotation by using the following command immediately after the activity.loadlayout. phone1.SetScreenOrientation(6) Attached is a small example with the Manifest entry that fails. Because the phone1.SetScreenOrientation(6) approach works it is not a great issue, but reading post #3 it seems the Manifest approach allows a single place to define multiple activity orientation - which may be useful at some stage. {Sorry - the layout is designed for 7" tablet so will not look too good on a smaller screen} Attachments sensorLandscapeTest.zip sensorLandscapeTest.zip 7.4 KB · Views: 394 Last edited: Oct 27, 2015 Upvote 0
I realize this is a older post but I have tried the Manifest approach to force screen orientation to sensorLandscape but my app will not "compile and run". It does a Test Compile without any problem. I am on B4A V2.71 with Core 2.71 and using Phone lib 2.10 When I add the following to the Manifest: SetActivityAttribute(Main,android:screenOrientation, "sensorLandscape") I get the following error when compiling: Parsing code. 0.02 Compiling code. 0.13 Compiling layouts code. 0.00 Generating R File. Error AndroidManifest.xml:17: error: Error: String types Not allowed (at 'screenOrientation' with value 'sensorLandscape'). I can however obtain the correct sensor landscape rotation by using the following command immediately after the activity.loadlayout. phone1.SetScreenOrientation(6) Attached is a small example with the Manifest entry that fails. Because the phone1.SetScreenOrientation(6) approach works it is not a great issue, but reading post #3 it seems the Manifest approach allows a single place to define multiple activity orientation - which may be useful at some stage. {Sorry - the layout is designed for 7" tablet so will not look too good on a smaller screen}
eurojam Well-Known Member Licensed User Longtime User Oct 27, 2015 #6 you should change the minSDK Version in the manifest to minSdkVersion="9" Upvote 0
G gz7tnn Member Licensed User Longtime User Oct 27, 2015 #7 Thanks for quick reply. I tried that and still no luck. Does the minSDK version translate to meaning that I need to have the Android 2.3.1 (API 9) SDK platform installed? If so then I don't have that one, and when I tried to install it I see it is obsolete. I tried setting the minSDK to 10 and 11 but no luck there. Excuse my ignorance in this area, so may not be understanding what this means. Will need to try again tomorrow. Upvote 0
Thanks for quick reply. I tried that and still no luck. Does the minSDK version translate to meaning that I need to have the Android 2.3.1 (API 9) SDK platform installed? If so then I don't have that one, and when I tried to install it I see it is obsolete. I tried setting the minSDK to 10 and 11 but no luck there. Excuse my ignorance in this area, so may not be understanding what this means. Will need to try again tomorrow.
eurojam Well-Known Member Licensed User Longtime User Oct 27, 2015 #8 that is strange, with b4a 5.2 it works as it is...no problems so far Upvote 0