作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 SimpleOrientationSensor 在我的应用程序中获取屏幕方向信息。我正在 Windows 模拟器中测试此应用程序,但我总是将传感器对象的值设置为 null。
这就是我正在做的:
SimpleOrientationSensor sensor;
sensor = SimpleOrientationSensor.GetDefault();
if (sensor != null)
{
sensor.OrientationChanged += sensor_OrientationChanged;
}
我知道当没有可用的传感器时,SimpleOrientationSensor.GetDefault() 将返回 null。我应该调整模拟器以获取传感器信息吗?还是它甚至可以处理这些变化?
最佳答案
根据 this article模拟器不支持 SimpleOrientationSensor
类。
The Simulator doesn’t support the emulation of Orientation Sensor, and is only able to trigger a display orientation change.
关于c# - SimpleOrientationSensor 返回 Null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12853799/
我正在使用 SimpleOrientationSensor 在我的应用程序中获取屏幕方向信息。我正在 Windows 模拟器中测试此应用程序,但我总是将传感器对象的值设置为 null。 这就是我正在做
我是一名优秀的程序员,十分优秀!