在 Android 模拟器中切换到横向模式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2618967/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Switching to landscape mode in Android Emulator
提问by codeman
This is probably a pretty easy to answer question, but I can't find the solution myself after a couple hours of searching the documentation and Google. I set the orientation of my Android app to landscape
in the AndroidManifest.xml
file:
这可能是一个很容易回答的问题,但在搜索文档和谷歌几个小时后,我自己找不到解决方案。我landscape
在AndroidManifest.xml
文件中将我的 Android 应用程序的方向设置为:
android:screenOrientation="landscape"
However, when I run the app in the simulator, it appears sideways and in portrait mode. How can I switch the emulator to landscape
mode on a mac
? It's running the 1.6 SDK.
但是,当我在模拟器中运行该应用程序时,它以横向和纵向模式显示。如何将模拟器切换到landscape
模式mac
?它正在运行 1.6 SDK。
回答by Bhimesh Chinta
Try:
尝试:
- ctrl+fn+F11on Mac to change the landscape to portrait and vice versa.
- left-ctrl+F11on Windows 7.
- ctrl+F11on Linux.
- ctrl+ fn+F11在 Mac 上将横向更改为纵向,反之亦然。
- left-ctrl+F11在 Windows 7 上。
- ctrl+F11在 Linux 上。
For Mac users, you only need to use the fnkey if the setting "Use all F1, F2etc. keys as function keys" (under System Preferences -> Keyboard) is checked.
对于Mac用户,你只需要使用fn钥匙如果设置“使用一切F1,F2等键用作功能键”(在系统偏好设置- >键盘)被选中。
- left-ctrl+F11on Windows 7 It works fine in Windows 7 for android emulator to change the landscape orientation to portrait and vice versa.
- left-ctrl+F11在 Windows 7 上它在 Windows 7 中运行良好,用于 android 模拟器将横向更改为纵向,反之亦然。
回答by fornwall
Not sure about your question - "sideways" is the same as "landscape".
不确定您的问题-“横向”与“横向”相同。
If you mean how to switch during runtime:
如果您的意思是如何在运行时切换:
- Switch to previous layout orientation (for example, portrait, landscape): KEYPAD_7, Ctrl+ F11
- Switch to next layout orientation (for example, portrait, landscape): KEYPAD_9, Ctrl+ F12
- 切换到之前的布局方向(例如,纵向、横向):KEYPAD_7, Ctrl+F11
- 切换到下一个布局方向(例如,纵向、横向):KEYPAD_9, Ctrl+F12
From docs.
从文档。
回答by Akshay Paliwal
Just use 9in numeric keyboard with num-lock off.
只需9在关闭 num-lock 的数字键盘中使用即可。
7 rotates in the opposite direction.
7 向相反方向旋转。
回答by akshay
Android Emulator Shortcuts
Android 模拟器快捷方式
Ctrl+F11Switch layout orientation portrait/landscape backwards
Ctrl+F11向后切换布局方向纵向/横向
Ctrl+F12Switch layout orientation portrait/landscape forwards
Ctrl+F12向前切换布局方向纵向/横向
- Main Device Keys
- 主要设备密钥
HomeHome Button
Home主页按钮
F2Left Softkey / Menu / Settings button (or PgUp)
F2左软键/菜单/设置按钮(或PgUp)
Shift+F2Right Softkey / Star button (or PgDn)
Shift+F2右软键/星形按钮(或PgDn)
EscBack Button
Esc返回键
F3Call/ dial Button
F3呼叫/拨号按钮
F4Hang up / end call button
F4挂断/结束通话按钮
F5Search Button
F5搜索按钮
- Other Device Keys
- 其他设备密钥
Ctrl+F5Volume up (or + on numeric keyboard with Num Lock off) Ctrl+F6 Volume down (or + on numeric keyboard with Num Lock off) F7Power Button Ctrl+F3Camera Button
Ctrl+F5提高音量(或数字键盘上的 + 关闭 Num Lock) Ctrl+F6 降低音量(或数字键盘上的 + 关闭 Num Lock)F7电源按钮Ctrl+F3相机按钮
Ctrl+F11Switch layout orientation portrait/landscape backwards
Ctrl+F11向后切换布局方向纵向/横向
Ctrl+F12Switch layout orientation portrait/landscape forwards
Ctrl+F12切换布局方向纵向/横向向前
F8Toggle cell network
F8切换蜂窝网络
F9Toggle code profiling
F9切换代码分析
Alt+EnterToggle fullscreen mode
Alt+Enter切换全屏模式
F6Toggle trackball mode
F6切换轨迹球模式
回答by Rehan Ali
Ctrl+F11or Ctrl+F12to change the orientation of the android emulator on windows
Ctrl+F11或Ctrl+F12在 Windows 上更改 android 模拟器的方向
回答by Grigori A.
On iMac with long keyboard (keyboard with numeric keypad at the right):
在配备长键盘的 iMac 上(右侧带有数字小键盘的键盘):
(1) Cmd + 7 (on numeric part of keyboard)
(2) Cmd + 9 (on numeric part of keyboard)
回答by Helzgate
I'm using Android Studio and none of the suggestions worked. I can turn the emulator but it stays in portrait. I didn't want to add a command in the manifest forcing landscape. The fix for me was:
我正在使用 Android Studio,但没有任何建议奏效。我可以转动模拟器,但它保持纵向。我不想在清单强制环境中添加命令。对我来说修复是:
turn the emulator to landscape mode using ctrlF11(the image will still be in portrait though)
Open up the camera in the os, it opens up in landscape mode, the only app that does this
without doing anything else, debug my app from Android Studio and now it shows up in landscape
使用将模拟器切换到横向模式ctrlF11(尽管图像仍然是纵向的)
在操作系统中打开相机,它在横向模式下打开,这是唯一执行此操作的应用程序
不做任何其他事情,从 Android Studio 调试我的应用程序,现在它以横向显示
回答by ammar shahid
Just a little bug (Bug for me) I found on mac emulator.
只是我在 mac 模拟器上发现的一个小错误(对我来说是错误)。
On changing the orientation to landscape (CtrlCmdF11) it changes to landscape but content shows in portrait format.for that:
在将方向更改为横向 ( CtrlCmdF11) 时,它会更改为横向,但内容以纵向格式显示。为此:
Go to emulator: Settings-> Display->When device is rotated->Rotate the contents of the screen
转到模拟器:设置-> 显示-> 设备旋转时-> 旋转屏幕内容
回答by Nick
I have found that sometimes the CTRL+ F11combination just doesn't do it for me. I have solved it by disabling the keyboard input in the emulator settings.
我发现有时CTRL+F11组合对我不起作用。我已经通过在模拟器设置中禁用键盘输入来解决它。
To do that, go to your emulator settings, klick the "show advanced settings" button and scroll all the way down. Then, disable the "enable keyboard input" option.
为此,请转到您的模拟器设置,单击“显示高级设置”按钮并一直向下滚动。然后,禁用“启用键盘输入”选项。
After doing that, try to start your emulator again, and the CTRL+ F11combination should work.
这样做之后,尝试再次启动您的模拟器,CTRL+F11组合应该可以工作。
回答by Novice programmer
Here are some ways to move landscape on Android Emulator:
以下是在 Android 模拟器上移动横向的一些方法:
1. Mac:
1. 马克:
Ctrl + Fn + F11
Keypad 7
orKeypad 9
Ctrl + F12
orCtrl + Fn + F12
Command + 7
orCommand + 9
Ctrl + Fn + F11
Keypad 7
或者Keypad 9
Ctrl + F12
或者Ctrl + Fn + F12
Command + 7
或者Command + 9
2. Windows:
2. 窗户:
Left Ctrl + F11
orCtrl + F12
Left Ctrl + F11
或者Ctrl + F12
3. Linux:
3.Linux:
Ctrl + F11
Ctrl + F11
4. Android studio :
4.安卓工作室:
We can write screenOrientation = "landscape"
in the androidManifest.xml
file.
我们可以screenOrientation = "landscape"
在androidManifest.xml
文件中写入。
5. Keyboard:
5. 键盘:
in side the emulator, turn off the Num-Lock and press Keypad 7
and Keypad 9
.
在模拟器旁边,关闭 Num-Lock 并按Keypad 7
和 Keypad 9
。
6. Emulator:
6. 模拟器:
- click the rotate button on the screen shown below.
- 单击下图所示屏幕上的旋转按钮。
click the rotate button on the screen shown below.
单击下图所示屏幕上的旋转按钮。