简体   繁体   English

如何在 Android 模拟器上捏缩放?

[英]How to pinch zoom on Android emulator?

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 模拟器中测试缩放,任何快捷键或任何其他方式?

With a mouse:用鼠标:

Press and hold Ctrl and press and hold left mouse and while doing that move your mouse.按住Ctrl并按住鼠标左键,同时移动鼠标。

With a trackpad:使用触控板:

Press and hold Ctrl and press and hold your trackpad and move with a finger to the LEFT and RIGHT (not up and down).按住Ctrl并按住触控板并用手指向左和向右移动(而不是向上和向下)。

Since ADT 17, it is possible to use a physical Android 4.0 device to send multitouch gestures to the emulator.从 ADT 17 开始,可以使用物理 Android 4.0 设备向模拟器发送多点触控手势。 See Android's instructions here .请在此处查看 Android 的说明

Multi-Touch多点触摸

The emulator supports multi-touch input, as an experimental feature in r17, using a tethered Android device running the SdkControllerMultitouch application.该模拟器支持多点触控输入,作为 r17 中的一项实验性功能,使用运行 SdkControllerMultitouch 应用程序的系留 Android 设备。 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.这需要 Android 4.0 或更高版本的系统映像。 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.建议在模拟器设置的开发人员部分启用“显示触摸”,以准确查看发送触摸的位置。

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.我的建议是直接在真实设备上测试您的应用程序,因为它更健壮,甚至性能更高。

I know it's late reply but this might save someones time.我知道回复晚了,但这可能会节省一些人的时间。

Double-click and then hold down the second click and move the mouse up to zoom out or down to zoom in .双击然后按住第二次单击并向上移动鼠标缩小向下移动鼠标放大

Hope this works!希望这有效!

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 和普通 Nexus 5 API 24 模拟器的 Mac 上,您只需按住cmd ( )。

在此处输入图像描述

The drag points will appear.拖动点将出现。 After that just left click and drag anywhere on the screen!之后只需左键单击并拖动到屏幕上的任意位置!

OK, I was experimenting a bit, and on the bluestacks android emulator, I've figured it out.好的,我做了一些实验,在 bluestacks android 模拟器上,我已经弄明白了。

It is Ctrl+Mouse wheel .它是Ctrl+鼠标滚轮 Works for me, hope it helps you too.对我有用,希望对你也有帮助。

I know this is old but this might still help someone.我知道这很旧,但这可能仍然对某人有帮助。

On 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 (在触控板上)

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 工具版本 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).否则,看起来在真实设备上测试更适合这种情况(而且通常速度也更快)。

For mac: Use the ⌥ Option key and then use your mouse or trackpad to pinch/zoom.对于 mac:使用⌥ Option键,然后使用鼠标或触控板进行捏合/缩放。 This is working on the android studio emulator.这适用于 android 工作室模拟器。

You can find all the shortcuts in the extended controls menu, by pressing the three dots on the menu and then navigating to "help".您可以在扩展控件菜单中找到所有快捷方式,方法是按菜单上的三个点,然后导航至“帮助”。

  1. Click 3 points (like preferences on emulator)单击 3 点(如模拟器上的首选项)
  2. Settings设置
  3. set param "Send keyboard shortcuts to" from "Virtual device" to "Emulator controls" now gestures work perfect!将参数“发送键盘快捷方式到”从“虚拟设备”设置为“模拟器控件”现在手势工作完美!

An Android Emulator doesn't support multi-touch you can't test it on emulators. Android 模拟器不支持多点触控,您无法在模拟器上对其进行测试。 Please use real-device for multitouch testing.请使用真机进行多点触控测试。

For recent developments in this regard read this - http://tools.android.com/tips/hardware-emulation对于这方面的最新发展,请阅读此 - http://tools.android.com/tips/hardware-emulation

PinchZoom works on Multi-Touch. PinchZoom 适用于多点触控。

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 具有功能但我从未尝试

  1. CTRL + a click on left side of the view screen will zoom out. CTRL + 单击视图屏幕左侧将缩小。

  2. Double click on a location will zoom in.双击某个位置将放大。

  3. North and South -> Scroll wheel - up and down南北 -> 滚轮 - 上下

  4. West-> CTRL+Scroll up at left side of the screen West-> CTRL+在屏幕左侧向上滚动

  5. East-> CTRL+Scroll up at right side of the screen东-> CTRL+屏幕右侧向上滚动

On macbook with Android studio Bumblebee, I have to hold control first which lets the drag pointer to appear on the screen.在带有 Android studio Bumblebee 的 macbook 上,我必须先按住控制键,让拖动指针出现在屏幕上。 Then all I need to do is double tap, hold the second tap, and drag to zoom-in/out.然后我需要做的就是双击,按住第二次,然后拖动以放大/缩小。

As of March 1, 2016 for the Android Studio's emulator on Windows. The pinch key on the emulator is the Alt key.截至2016年3月1日Windows上Android Studio的模拟器。模拟器上的捏合键是Alt键。 Hold down Alt and click and drag your mouse button.按住 Alt 并单击并拖动鼠标按钮。

The CTRL key might still work for you, but it doesn't work for me. CTRL 键可能对您仍然有效,但对我无效。

You can not able to test pinch zoom in Emulator.您无法在模拟器中测试捏合缩放。 Please use Real device to test pinch zoom effect.请使用真机测试双指缩放效果。

I have not try with youwave.我还没有尝试过 youwave。 May be you can able to test pinch in that environment.也许你可以在那个环境中测试捏。 Not sur but just try with it.不是 sur,只是尝试一下。

Enjoy Coding....享受编码....

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

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