Bug 26636 - Overriding GetSupportedInterfaceOrientation in a PageRenderer does not work as expected
Summary: Overriding GetSupportedInterfaceOrientation in a PageRenderer does not work a...
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.2
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-02-02 10:31 UTC by John Miller [MSFT]
Modified: 2015-02-15 17:51 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

Test Projects (211.37 KB, application/zip)
2015-02-02 10:31 UTC, John Miller [MSFT]

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description John Miller [MSFT] 2015-02-02 10:31:51 UTC
Created attachment 9599 [details]
Test Projects


   When trying to specify supported orientations for a page on iOS, UIViewController.GetSupportedInterfaceOrientations is overridden to provide a mask of supported orientations. Implementing this in a PageRenderer does not work as expected. 

**Steps to Reproduce:**

   1. Run the attached Forms iOS project on a simulator
   2. Rotate the simulator.

   To compare:
   1. Run the attached -Native ios project on a simulator
   2. Rotate the simulator

**Actual Results:**

   In the Forms iOS project using the PageRenderer, the screen is still rotated to Landscape, etc. 

**Expected Results:**

   The Screen should not rotate when in Landscape orientations because only Portrait is returned in the GetSupportedOrientations in the PageRenderer.

**Build Date & Platform:**

   iOS 8.1

**Additional Information:**

   There is also a native obj-c project in the zip to show that a traditional Xamarin.iOS and obj-c project provide the expected results. It is unclear how to reproduce this behavior in Forms since the PageRenderer is not working as expected.
Comment 1 Rajneesh Kumar 2015-02-03 07:42:07 UTC
I have tried this issue and able to reproduce this. To reproduce this issue I have followed the steps and instruction provided in bug description. 
After running Forms iOS project using the page renderer , I observed that when I rotate the simulator, the screen is still rotated to Landscape. Please refer the screencast: http://www.screencast.com/t/nAnmYguBsZ

Ide Logs: https://gist.github.com/Rajneesh360Logica/21467eaaadea9718e9e8
iOS Designer Logs: https://gist.github.com/Rajneesh360Logica/5f6330b1501fc26bc154
Simulator Logs: https://gist.github.com/Rajneesh360Logica/85c224155f65b727e6fe
Application  Output: https://gist.github.com/Rajneesh360Logica/3545bc8c1c179168d778
Build Output: https://gist.github.com/Rajneesh360Logica/caf1b5c71c40007f21be

Environment Info:

Xamarin.Forms Version:

=== Xamarin Studio ===

Version 5.7.1 (build 16)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

=== Xamarin.Android ===

Version: (Business Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 3b3ef43
Build date: 2015-01-24 09:42:21-0500

=== Xamarin.Mac ===

Version: (Business Edition)

=== Build Information ===

Release ID: 507010016
Git revision: f12fcaf4707ab436bee2df6263eb5333197b262c
Build date: 2015-02-01 21:06:05-05
Xamarin addins: f7b7d34419c9ec24501bfa7c658e80a6305613e0

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 2 Rui Marinho 2015-02-15 17:51:25 UTC
The sample wasn't using the StartPage that's why the renderer wasn't working.