Set the orientation to portrait from code

前端 未结 2 788
独厮守ぢ
独厮守ぢ 2021-01-23 01:23

I know I can limit the orientation from the manifest file. Like this

android:screenOrientation=\"portrait\"

But is it possible to set the orien

相关标签:
2条回答
  • 2021-01-23 02:05
    Activity. setRequestedOrientation(..)
    
    0 讨论(0)
  • 2021-01-23 02:15
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    
    0 讨论(0)
提交回复
热议问题