Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to lock orientation of a device programmatically

$
0
0

I am testing my experimental launcher app, and using a customer button, I am trying to lock the orientation of the device by calling the following code:
mainActivity.RequestedOrientation = ScreenOrientation.Locked;
but it only works just for the launcher app. It does not change the lock on the orientation of the device as a whole. And if I open some other app, the orientation gets unlocked.
Any solution /tips will be helpful.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>