Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在我的 Android 设备上获取指南针方向。因此,我尝试使用 Xamarin.Mobile 组件获取航向,但由于该线程报告航向始终为 0。还有其他可能在我的 Android 设备上获取指南针航向吗?
首先,您需要检查您的设备是否支持 CompassHeading,因为并非所有设备都支持它。所以要检查,请使用 Xamarin.Geolocation.Geolocator.SupportsHeading,如果设备支持标题,它将返回 true。还可以尝试 google play 上的“指南针”应用程序之一,以确保您的设备是否支持它。