How to set android:screenOrientation=“portrait” for Camera

后端 未结 4 1336
长发绾君心
长发绾君心 2021-01-27 10:35

I am using Samsung Galaxy Note to run a phonegap application. When I take picture, I can see that screen rotates just before entering camera. How can I disable this?

I h

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-27 11:20

    There are 2 things here that should be taken into account. First, this

    android:screenOrientation="landscape"
    

    has no effect if in the java code there is something like this:

    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    

    Then, there is this other method that could be bothering you:

    mCamera.setDisplayOrientation(90);
    

    This would rotate your camera preview.

    Hope this helps!

提交回复
热议问题