Forum Xamarin.iOS
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Subclassing UINavigationController

OsmanEsenOsmanEsen DKMember
edited March 2016 in Xamarin.iOS


I have a storyboard consisting of a UINavigationController as an initial view controller and several UIViewControllers. I want one of my UIViewControllers to lock screen orientation to portrait, but according to a short research, I need to subclass my UINavigationController. Is there any coding examples of how to subclass a UINavigationController ?.


  • trinnguyentrinnguyen VNMember ✭✭

    try this:

    public class CustomNavigationController : UINavigationController
        public CustomNavigationController(IntPtr handler) : base(handler)
        public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations()
            //return orientation here
Sign In or Register to comment.