草庐IT

ObserveOrientationDidChange

全部标签

c# - Xamarin iOS ObserveOrientationDidChange 横向或纵向

我需要检测用户何时将设备旋转到横向。我可以使用以下代码检测方向何时发生变化:UIDevice.CurrentDevice.BeginGeneratingDeviceOrientationNotifications();this.orientationObserver=UIDevice.Notifications.ObserveOrientationDidChange(MyRotationCallback);privatevoidMyRotationCallback(objectsender,NSNotificationEventArgse){//LandscapeorPortrait?