- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试使用来自 Accelerometer 对象的 Shaken 事件检测我手机上的震动。加速度计对象不为空,但当我摇动手机时,它永远不会进入 _accelerometer_Shaken
事件。
public int shakeCount = 0;
Accelerometer _accelerometer = Accelerometer.GetDefault();
public MainPage()
{
this.InitializeComponent();
if (_accelerometer != null)
{
_accelerometer.Shaken += _accelerometer_Shaken;
}
}
async private void _accelerometer_Shaken(Accelerometer sender, AccelerometerShakenEventArgs args)
{
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
shakeCount++;
tbInfo.Text = shakeCount.ToString();
});
}
我不明白为什么
最佳答案
尚不支持此功能。
这是官方示例代码的摘录
https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/Accelerometer
Accelerometer Shake Events
When you choose the Enable button for the Shake Events option, the app displays the cumulative number of shake events each time an event occurs. (The app first increments the event count and then renders the most recent value.)
Note that shake events are not supported in Windows 10 build 10240, so the Shaken event will never be raised, but the sample demonstrates how to handle the event when support for shake is added.
我在Windows 10 10586下测试过,还是不行。
关于c# - Windows 通用应用程序中的加速度计摇动事件不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34569608/
我是gradle工具的新手,并获得了下一个项目。 TestNG测试某些类,并用@Test注释。 buid.gradle,那里有个小脚本。 test { dependsOn cleanRepor
有没有办法让 div 框在页面加载时抖动?比如可能只有一次或两次? 更新:在这个 URL 上我仍然无法加载页面,我做错了什么? http://tinyurl.com/79azbav 我想我卡在了页面加
我正在尝试为我的游戏调整 html 元素。 我在这里找到这段代码: shake = function (sprite, magnitude = 16, angular = false) { //A
我的意图是在用户执行摇动手势时清空 2 个数组内的值 - force[] 和 stiffness[],来自 prepareforsegue 的另一个类。下面是我的代码,然后是我遇到的错误。 sprin
您好,如果用户名/密码输入错误,我想让我的 div 摇动。我尝试过的方法显然行不通...我认为这可能与我使用 javascript 的方式有关。提前致谢。 HTML/PHP/JavaScript:
是否可以在显示主屏幕时摇动 iPhone 并打开我的应用程序? 例如:触发 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)
我正在尝试在此代码中替换我的核心动画摇动效果 let shake = CAKeyframeAnimation(keyPath: "position.x") shake.values =
有时会出现创建目录mkdir的情况不是正确的工具。可能是git clone或rsync或mount 。所以当我们有这样的规则时: needDir dirs = filterM ((fmap not)
我需要创建一个带有子菜单的非常简单的响应式菜单。我目前遇到的问题是我的子菜单“抖动”,我不明白为什么。 谢谢! 这是我的HTML
我想在 Android 设备上捕捉“TAP”。例如,假设设备在用户的口袋里。然后他从口袋里摸了摸手机两次,并以一种特殊的方式摸了摸。比如说,用两个/三个手指敲打,比如“TAP -- TAP”。我想捕捉
在我的 iOS 应用程序中,我的屏幕上有一堆具有摆动效果的图标。当我按住其中一个时,它们开始摇晃(就像 iPhone 的菜单一样),但如果我按下主页按钮(将我的应用程序发送到后台),iPhone 就会
插入错误后,我想摇动一个文本字段。 为此,我编写了一个静态抖动动画 public static void shake(Node node) { TranslateTransition tt = n
我是一名优秀的程序员,十分优秀!