Activity screen not rotating when I rotate mobile

前端 未结 4 872
既然无缘
既然无缘 2020-12-17 18:57

I have used this code as @gnobal posted on https://stackoverflow.com/a/2700683/1556329 and it works great. But my issue is that I have found that when I apply Theme.Transpar

相关标签:
4条回答
  • 2020-12-17 19:31

    I have theme with android:windowIsTransluent and rotation stops. To turn it ON i have experiment by adding screenOrientation="sensor" for application, theme and first Activity. Adding rotation only for first Activity turn rotation on for all activities in application.

    0 讨论(0)
  • 2020-12-17 19:43

    If you set android:windowIsTranslucent or android:windowIsFloating to true rotation notifications are disabled (as long as you don't force them to be enabled with android:screenOrientation="sensor").

    0 讨论(0)
  • 2020-12-17 19:44

    you may check out this

                 android:screenOrientation="sensor"
    or 
                 android:screenOrientation="user" 
    

    add one of them to your manifest <activity............../>. and don't forget to add this to your application in manifest as well if you wish to avoid recreating your activity android:configChanges="keyboardHidden|orientation|screenSize"

    0 讨论(0)
  • 2020-12-17 19:45

    I had the same problem. Before doing any solutions, first be sure that rotation feature is enabled and then check your home screen that can be rotate, if no, Reboot your phone and the problem will be solved!

    0 讨论(0)
提交回复
热议问题