简体   繁体   English

Android Studio 的模拟器相机打开颠倒?

[英]Android Studio's emulator camera opening upside down?

I'm running a Nexus 5, API 23, and opening the camera with:我正在运行 Nexus 5、API 23,并使用以下命令打开相机:

    Intent captureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

However once this opens the camera appears upside down by default like this:但是,一旦打开,默认情况下相机会像这样上下颠倒:

倒置相机示例

I've checked other threads which say to disable 'Use Host GPU' and to set the activity's screenOrientation to sensorPortrait but these haven't worked.我检查了其他线程,这些线程说禁用“使用主机 GPU”并将活动的 screenOrientation 设置为 sensorPortrait,但这些都不起作用。 Any ideas?有任何想法吗?

In the Android Emulator, press the 3 dots ( ... ).在 Android 模拟器中,按 3 个点 ( ... )。 Then click on Virtual Sensors .然后单击Virtual Sensors

When in the menu, there are 4 presets.在菜单中,有 4 个预设。 You want to press the first one, which is upright.你想按第一个,它是直立的。 You may also have to use the other (upside down) one.您可能还必须使用另一个(倒置)。

虚拟传感器菜单

You can try the hard way :你可以尝试困难的方式:

  • There is a button in the side bar.侧栏中有一个按钮。 Try using that尝试使用

  • CTRL + F11 CTRL + F11

  • Mac : CMD + F11 Mac : CMD + F11

我遇到了所有应用程序的相机都颠倒的问题,奇怪的是,当我进入模拟器设置并取消选中“启用键盘输入”时,这个问题得到了解决

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM