在Windows Phone 8.1上摇一摇 [英] Shake on Windows Phone 8.1

查看:64
本文介绍了在Windows Phone 8.1上摇一摇的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我想实施一个"震动"我的Windows Phone 8.1应用程序的事件,使用设备的加速度计。  经过一番研究,看来WP8.1上没有震动事件。  

I would like to implement a "shake" event for my Windows Phone 8.1 application, using the device's accelerometer.  After some research, it appears that there is no shake event on WP8.1.  

我查看了"ShakeGestures"和"ShakeGestures"。来自Microsoft的DLL,但它不支持WP8.1。  该库使用  Microsoft.Devices。传感器   ;
目标是Windows Phone 8(不是8.1)和Windows Phone 
Silverlight   8.1
(与Windows Phone 8.1不同)。 Windows Phone 8.1使用 
Windows。 Devices.Sensors

I looked at the "ShakeGestures" DLL from Microsoft, but it doesn't support WP8.1.  That library uses  Microsoft.Devices.Sensors which targets Windows Phone 8 (not 8.1) and Windows Phone Silverlight 8.1 (not the same as Windows Phone 8.1). Windows Phone 8.1 uses Windows.Devices.Sensors

有没有办法检测并响应用户摇动手机而不编写我们自己的逻辑和事件?  如果我们必须编写自己的逻辑,是否有任何适用于WP8.1的示例?
$


谢谢!

Is there a way to detect and respond to the user shaking their phone without writing our own logic and event?  If we must write our own logic, are there any examples which work on WP8.1 ?

Thank you!

推荐答案

在这里查看这个示例项目。

have a look at this sample project here.

https:/ /code.msdn.microsoft.com/Accelerometer-Sensor-Sample-22982671#content

https://code.msdn.microsoft.com/Accelerometer-Sensor-Sample-22982671#content

WP8.1的许多有用示例:

And lot of more useful samples for WP8.1:

https://code.msdn.microsoft.com/Windows-Phone-81-samples-08631ca7/view/SamplePack/1?sortBy=TitleAsc

https://code.msdn.microsoft.com/Windows-Phone-81-samples-08631ca7/view/SamplePack/1?sortBy=TitleAsc

希望有所帮助。

祝福。


这篇关于在Windows Phone 8.1上摇一摇的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆