: UIInterfaceOrientation.Portrait, animated: true) Public override void ViewWillAppear(bool animated) If (page != null & page.RequestLandScapeView) Protected override void OnElementChanged(VisualElementChangedEventArgs e) If (e.PropertyName.Equals())Īnd the iOS: public class CustomContentPageRenderer : PageRenderer Protected override void OnElementPropert圜hanged(object sender, Propert圜hangedEventArgs e)īase.OnElementPropert圜hanged(sender, e) Var activity = Forms.Context as MainActivity Īctivity.RequestedOrientation = page.RequestLandScapeView Protected override void OnElementChanged(ElementChangedEventArgs e) Then create PageRenderer for Android and iOS.įist is Android: public class CustomContentPageRenderer : PageRenderer Whenever you need you page with Landscape mode, you just need set RequestLandScapeMode = true and RequestLandScapeMode = false to Portrait mode. Public static readonly BindableProperty RequestLandScapeViewProperty =īindableProperty.Create(nameof(RequestLandScapeView), typeof(bool), typeof(CustomContentPage), Set => SetValue(RequestLandScapeViewProperty, value) Get => (bool) GetValue(RequestLandScapeViewProperty) In the Forms create your custom ContentPage public class CustomContentPage : ContentPage In this blog, I will show you how to do that. In many case we need Landscape mode to do something, and back to Portrait mode.