Android 无法在模拟器上捏缩放
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10023554/
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
not able to pinch zoom on emulator
提问by vipin
I have an application in which I need to implement image editing, which also includes pinch zooming. I am done with pinch zooming but I can test this only on device, not on emulator.
我有一个应用程序,我需要在其中实现图像编辑,其中还包括双指缩放。我已经完成了捏合缩放,但我只能在设备上进行测试,而不能在模拟器上进行测试。
Is there any way for testing pinch zooming in android emulator, any shortcut key or any other way?
有什么方法可以测试android模拟器中的捏缩放,任何快捷键或任何其他方式?
采纳答案by K_Anas
Since ADT 17, it is possible to use a physical Android 4.0 device to send multitouch gestures to the emulator.See Android's instructions here.
从 ADT 17 开始,可以使用物理 Android 4.0 设备向模拟器发送多点触控手势。请参阅此处的 Android 说明。
Multi-Touch
多点触摸
The emulator supports multi-touch input, as an experimental feature in r17, using a tethered Android device running the SdkControllerMultitouch application. The application contains an activity that monitors touch inputs and sends them to the emulator. This requires an Android 4.0 or later system image. The activity displays the content of the emulator screens to help with interactivity. It is recommended to enable "show touches" in the Developer section of the Settings on the emulator to see exactly where the touches are sent.
模拟器支持多点触控输入,作为 r17 中的一项实验性功能,使用运行 SdkControllerMultitouch 应用程序的绑定 Android 设备。该应用程序包含一个活动,用于监视触摸输入并将其发送到模拟器。这需要 Android 4.0 或更高版本的系统映像。该活动显示模拟器屏幕的内容以帮助进行交互。建议在模拟器设置的开发者部分启用“显示触摸”,以准确查看触摸发送的位置。
The SdkControllerSensor application source code is located in
SdkControllerSensor 应用程序源代码位于
$SDK/tools/apps/SdkControllerMultitouch/
$SDK/tools/apps/SdkControllerMultitouch/
But this is still a workaround since we need a real device. My advice would be to test your app directly on a real device as it's more robust, and even more performant.
但这仍然是一种解决方法,因为我们需要一个真正的设备。我的建议是直接在真实设备上测试您的应用程序,因为它更健壮、性能更高。
回答by yowbro
With a mouse:
用鼠标:
Press and hold Ctrland press and hold left mouse and while doing that move your mouse.
按住并按住Ctrl鼠标左键,同时移动鼠标。
With a trackpad:
使用触控板:
Press and hold Ctrland press and hold your trackpad and move with a finger to the LEFT and RIGHT (not up and down).
按住并按住Ctrl触控板,然后用手指向左和向右移动(不是上下)。
回答by Radu
On a Mac running the latest version of AndroidStudio and a vanilla Nexus 5 API 24 emulator all you have to do is keep cmd(?) pressed.
在运行最新版本 AndroidStudio 和 vanilla Nexus 5 API 24 模拟器的 Mac 上,您所要做的就是按住cmd( ?)。
The drag points will appear. After that just left click and drag anywhere on the screen!
将出现拖动点。之后只需左键单击并拖动屏幕上的任意位置!
回答by Emzor
I know this is old but this might still help someone.
我知道这很旧,但这可能仍然对某人有所帮助。
On mac:
在 Mac 上:
To zoom in
use double click
(on track pad)
要 zoom in
使用double click
(轨迹板)
To zoom out
use Command + Shift + click
(on track pad)
要zoom out
使用Command + Shift + click
(轨迹板)
回答by Andy8583
OK, I was experimenting a bit, and on the bluestacks android emulator, I've figured it out.
好的,我做了一些实验,在 bluestacks android 模拟器上,我想通了。
It is Ctrl+Mouse wheel. Works for me, hope it helps you too.
它是Ctrl+鼠标滚轮。对我有用,希望它也能帮助你。
回答by ppreetikaa
I know it's late reply but this might save someones time.
我知道回复晚了,但这可能会节省一些人的时间。
Double-clickand then hold down the second click and move the mouse up to zoom outor down to zoom in.
双击然后按住第二次单击并向上移动鼠标以缩小或向下移动以放大。
Hope this works!
希望这有效!
回答by Snicolas
There has been some progress in this field with android tools release 17 : you can use a device to control the emulator : http://developer.android.com/sdk/tools-notes.html.
android tools release 17 在这个领域取得了一些进展:您可以使用设备来控制模拟器:http: //developer.android.com/sdk/tools-notes.html。
Otherwise, it looks like testing on real device is just better for this case (and in general its also much faster).
否则,看起来在真实设备上测试更适合这种情况(通常它也更快)。
回答by Marius Kohmann
For mac: Use the ? Optionkey and then use your mouse or trackpad to pinch/zoom. This is working on the android studio emulator.
对于 Mac:使用? Option键,然后使用鼠标或触控板进行捏合/缩放。这是在 android studio 模拟器上工作的。
You can find all the shortcuts in the extended controls menu, by pressing the three dots on the menu and then navigating to "help".
您可以在扩展控件菜单中找到所有快捷方式,方法是按菜单上的三个点,然后导航到“帮助”。
回答by Alex Palance
- Click 3 points (like preferences on emulator)
- Settings
- set param "Send keyboard shortcuts to" from "Virtual device" to "Emulator controls" now gestures work perfect!
- 单击 3 个点(如模拟器上的首选项)
- 设置
- 将参数“将键盘快捷键发送到”从“虚拟设备”设置为“模拟器控件”现在手势工作完美!
回答by MKJParekh
PinchZoom works on Multi-Touch.
PinchZoom 适用于 Multi-Touch。
If the device is supporting multi-touch then only your code will work else it wont work.
如果设备支持多点触控,那么只有您的代码可以工作,否则它将无法工作。
As the Android Emulators doesn't support multi-touch you can't test it on emulators.
由于 Android 模拟器不支持多点触控,因此您无法在模拟器上对其进行测试。
Still new ADT has feature But I never tried this
不过新的ADT具有的功能,但我从来没有尝试过这个