IanMc Well-Known Member Licensed User Longtime User Aug 5, 2014 #1 When I set it to Portrait it works great but I'd like it to change to right way up when I turn the device 180degrees. I have an ebook reader called moonreader which does this so I know its possible. Is there a way to do it in B4a?
When I set it to Portrait it works great but I'd like it to change to right way up when I turn the device 180degrees. I have an ebook reader called moonreader which does this so I know its possible. Is there a way to do it in B4a?
NJDude Expert Licensed User Longtime User Aug 5, 2014 #2 Use: sensorPortrait. In some rare cases, that doesn't work on certain devices. Upvote 0
IanMc Well-Known Member Licensed User Longtime User Aug 5, 2014 #3 Sounds good, I'll give it a try thanks! Yep works! How cool, NJ nails it again. B4a is so cool! btw... any idea what it does in those rare cases? does it still lock to portrait? Last edited: Aug 5, 2014 Upvote 0
Sounds good, I'll give it a try thanks! Yep works! How cool, NJ nails it again. B4a is so cool! btw... any idea what it does in those rare cases? does it still lock to portrait?
P Picena Informatica Active Member Licensed User Longtime User Aug 5, 2014 #4 phone.setscreenorientation(9) not in all devices. Upvote 0
IanMc Well-Known Member Licensed User Longtime User Aug 5, 2014 #5 Thank you person with unpronounceable name but as NJ advised, in the project I did this: B4X: #Region Project Attributes #ApplicationLabel: Android Looper #VersionCode: 1 #VersionName: 1 'SupportedOrientations possible values: unspecified, landscape or portrait. #SupportedOrientations: sensorPortrait #CanInstallToExternalStorage: False #End Region used the sensorPortrait attribute and it works a charm. Upvote 0
Thank you person with unpronounceable name but as NJ advised, in the project I did this: B4X: #Region Project Attributes #ApplicationLabel: Android Looper #VersionCode: 1 #VersionName: 1 'SupportedOrientations possible values: unspecified, landscape or portrait. #SupportedOrientations: sensorPortrait #CanInstallToExternalStorage: False #End Region used the sensorPortrait attribute and it works a charm.
P Picena Informatica Active Member Licensed User Longtime User Aug 5, 2014 #6 I think that sensorportrait dont works in phones (avoiding invert mic and speaker). So i use .setscreenorientation(9). Upvote 0
I think that sensorportrait dont works in phones (avoiding invert mic and speaker). So i use .setscreenorientation(9).
IanMc Well-Known Member Licensed User Longtime User Aug 5, 2014 #7 Ah! I'll just try it on my phone... stand by... It works on my phone but my phone is a bit of a special one. I hope that if it doesn't work on some devices then it just locks it to portrait even if its upside down when you turn it 180degrees. Upvote 0
Ah! I'll just try it on my phone... stand by... It works on my phone but my phone is a bit of a special one. I hope that if it doesn't work on some devices then it just locks it to portrait even if its upside down when you turn it 180degrees.
P Picena Informatica Active Member Licensed User Longtime User Aug 5, 2014 #8 In devices that not rotate upside down i can turn screen with that comnand. Upvote 0
IanMc Well-Known Member Licensed User Longtime User Aug 5, 2014 #9 Cool and thank you I'll try it like this then if I encounter problems I'll re-visit it. Upvote 0