我需要知道 iPad 2 是否有内置指南针并且仍然响应:
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
iPhone 的确切方式。我应该了解哪些差异?
谁能帮帮我?我只在很短的时间内接触到 iPad,并且没有收到此方法的回调。该应用程序在 iPhone 3GS/4 上运行良好
谢谢!
=============
我的代码是这样的:
- (void)accelerometer:(UIAccelerometer *)meter didAccelerate:(UIAcceleration *)acceleration {
switch (currentOrientation) {
case UIDeviceOrientationLandscapeLeft:
self.viewAngle = atan2(acceleration.x, acceleration.z);
break;
case UIDeviceOrientationLandscapeRight:
self.viewAngle = atan2(-acceleration.x, acceleration.z);
break;
case UIDeviceOrientationPortrait:
self.viewAngle = atan2(acceleration.y, acceleration.z);
break;
case UIDeviceOrientationPortraitUpsideDown:
self.viewAngle = atan2(-acceleration.y, acceleration.z);
break;
default:
break;
}
[self updateCurrentCoordinate];
但我从 GPSReader 获取航向
最佳答案
iPad2 有两个版本:-
仅 WiFi 和 WiFi + 3G
http://www.apple.com/ipad/specs/
位置
仅限 Wifi
* 无线网络
* 数字罗盘
无线+3G
* 无线网络
* 数字罗盘
* 辅助 GPS
* 手机
如果你能说出你到底得到了什么,因为 iPad 没有相同的方法。我有同样的问题,当我深入了解时,它让我更加复杂。
你能给出 x、y 和 z 轴的脚本以及过滤因子和调整吗?
你愿意分享你的 kFilteringFactor 吗?不完全知道该用什么,但也许这也有帮助。
关于ios - iPad 2 指南针?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6634642/