我正在考虑是否在我的应用程序中实现横屏模式。有没有一种分析软件可以告诉我用户是否尝试在横屏模式下查看我的应用程序?还是说我应该编写自己的方法?
我正在考虑是否在我的应用程序中实现横屏模式。有没有一种分析软件可以告诉我用户是否尝试在横屏模式下查看我的应用程序?还是说我应该编写自己的方法?
很难确定 shouldAutorotateToInterfaceOrientation:
调用是否针对所有方向,无论用户是否尝试进入横屏模式,并且 willRotate/didRotate 回调仅针对支持的方向进行。你可以做的是记录
[[UIDevice currentDevice] orientation];
在每个shouldAutorotateToInterfaceOrientation方法中调用。或者注册UIDeviceOrientationDidChangeNotification通知。这将返回一个UIDeviceOrientation,无论您的视图控制器的方向如何。请注意,这与UIViewControllers用于interfaceOrientation属性的UIInterfaceOrientation值不同。
typedef enum {
UIDeviceOrientationUnknown,
UIDeviceOrientationPortrait,
UIDeviceOrientationPortraitUpsideDown,
UIDeviceOrientationLandscapeLeft,
UIDeviceOrientationLandscapeRight,
UIDeviceOrientationFaceUp,
UIDeviceOrientationFaceDown
} UIDeviceOrientation;
typedef enum {
UIInterfaceOrientationPortrait = UIDeviceOrientationPortrait,
UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
UIInterfaceOrientationLandscapeLeft = UIDeviceOrientationLandscapeRight,
UIInterfaceOrientationLandscapeRight = UIDeviceOrientationLandscapeLeft
} UIInterfaceOrientation;
您可以使用Google Analytics用户计时功能来测量用户在特定方向上花费的时间间隔。您可以阅读有关为本机iOS应用程序跟踪用户计时的信息,访问https://developers.google.com/analytics/devguides/collection/ios/v2/usertimings