当我在设备上调用SensorManager.getDefaultSensor(Sensor.TYPE_ROTATION_VECTOR)时,它返回null.我知道这是一个虚拟传感器(做一些聪明的数学运算来从真实传感器中获取值).我返回null,因为我的设备没有ROTATION_VECTOR工作所需的硬件传感器之一.
所以我的问题是:
编辑:我们与三星谈到了这一点,并决定平板电脑中的陀螺仪传感器被打破,这就是为什么我们作为rotation_vector传感器得到空的原因.
我正在使用设计器重新托管样本,并试图将泛型类型放入工具箱中,但我似乎无法使其工作.
我尝试过XAML:
<sapt:ToolboxItemWrapper AssemblyName="{StaticResource AssemblyName}">
<sapt:ToolboxItemWrapper.ToolName>
System.Activities.Statements.ForEach
</sapt:ToolboxItemWrapper.ToolName>
</sapt:ToolboxItemWrapper>
Run Code Online (Sandbox Code Playgroud)
和基于代码:
Type t = Type.GetType("System.Activities.Statements.Foreach, System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
ToolboxItemWrapper w = new ToolboxItemWrapper(t);
category.Add(w);
Run Code Online (Sandbox Code Playgroud)
但是它们似乎都不起作用.有什么建议?