There is a problem with functionality. She decided that I would receive all position changes from the application by receiving messages on UIDeviceOrientationDidChangeNotification .

But for the purity of the decision I need to call my function only when changing the position from portrait to landscape and vice versa. Or rather, before the application changes its orientation. But I did not find a solution how to do it.

Once again, the essence of the issue. You need to understand how to capture the moment before the application changes orientation.

So far, the thought has stopped on finding how to catch the current angle or something similar through NSNotificationCenter.DefaultCenter.AddObserver .

I would be very happy with any help. Already tried many solutions in a roundabout way, but did not give any sense.

  • Will this help? "method is invoked when rotation takes place." developer.xamarin.com/api/member/… - Valentine
  • Look here: stackoverflow.com/a/36577000/608343 - Vitali Eller
  • Thank you all for the ideas. As a result, the renderer created the necessary pages and redefined the method public override void WillRotate (UIKit.UIInterfaceOrientation toInterfaceOrientation, double duration) - DarkOwl

1 answer 1

 [XamlCompilation(XamlCompilationOptions.Compile)] public partial class SomePageView : ContentPage { SomePageView() { this.SizeChanged += (sender, e) => { //Do something } } }