Tuesday, 6 September 2022

Lock orientation in Compose

I am trying to LOCK the screen orientation for the entry screen of my application, and then reverse back to normal for the actual app and its features.

val systemUiController = rememberSystemUiController()
val context = LocalContext.current

I watched this tutorial, https://www.youtube.com/watch?v=U5G25kcaNu0 which uses this line:

this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTAIT)

But, this is controlled from the activity. I want to know, if it is possible to do this per screen view.



from Lock orientation in Compose

No comments:

Post a Comment