Bug 25866 - Device Rotation or tilt closes MasterDetail Master page
Summary: Device Rotation or tilt closes MasterDetail Master page
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-01-09 06:45 UTC by tim.ahrentlov
Modified: 2015-03-12 13:38 UTC (History)
6 users (show)

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

Test Case to reproduce the bug (4.11 MB, application/zip)
2015-01-15 05:01 UTC, tim.ahrentlov

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 tim.ahrentlov 2015-01-09 06:45:57 UTC
The sligthest tilt or device rotation closes the MasterDetail Master page on iOS device. Even if rotation is barred in the iOS project.

Testers find it difficult to hold the devices still enough to select an item from the master page menu, before the master page slides shut due to device movement. They need to focus on holding the phone still while operating the menu.

I don't believe this bug was present in the 1.2x releases where the menu just stayed visible even during rotation if this was permitted in the iOS project.

We need to be able to make the MasterDetail master page visibility impervious to device tilt and rotation again.

Look at this video to see what I mean: https://dl.dropboxusercontent.com/u/2600860/IMG_0001.MOV
Comment 1 Ram Chandra 2015-01-09 11:41:30 UTC
Hi tim,

I tried to reproduce this issue but I am unable to reproduce this issue.

Could you please provide sample project, build info and the version of Xamarin.Forms you are using. So that we can reproduce this issue at our end.

You can get build info from here:
Xamarin Studio => About Xamarin Studio => Show Details => Copy Information.
Comment 2 tim.ahrentlov 2015-01-09 11:43:32 UTC
Would love to. As soon as you release a unified stable that allows me to deploy to device, I will upload a test case
Comment 3 tim.ahrentlov 2015-01-15 05:01:25 UTC
Created attachment 9362 [details]
Test Case to reproduce the bug

1. Run project on device
2. Press menu.
3. Tilt the device (like I do in the video)

Notice the drawer closes.
Comment 4 Ram Chandra 2015-01-15 10:35:42 UTC
@Tim: Thanks for the sample project

I have checked this issue and I am able to reproduce this issue. I observed that slightly tilt or change in device rotation closes the MasterDetail page on iOS device. 

System logs: https://gist.github.com/RamChBachkheti/5f4821adf0b9791793f4
Device logs: https://gist.github.com/RamChBachkheti/89b45d027ef240efc685

Environment Info:


=== Xamarin Studio ===

Version 5.7 (build 661)
Installation UUID: 6ea47b0d-1852-4aaf-808d-373ff0a5002b
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.iOS ===

Version: (Trial Edition)
Hash: dfb682f
Build date: 2015-01-08 13:39:32-0500

=== Xamarin.Android ===

Version: (Trial Edition)
Android SDK: /Users/jatin66/Desktop/Backup/android-sdk-macosx
	Supported Android versions:
		1.6    (API level 4)
		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)

=== Xamarin.Mac ===

Version: (Trial Edition)

=== Build Information ===

Release ID: 507000661
Git revision: b70bab61da996da29045ea8ee8aed1a6faedbe78
Build date: 2015-01-05 16:31:31-05
Xamarin addins: 82f6c71490562d6cd125a09287f441902fdac3d7

=== Operating System ===

Mac OS X 10.10.0
Darwin Jatin66s-iMac.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Comment 5 Eric Maupin 2015-01-28 18:03:34 UTC
This should be fixed in 1.3.2-pre1
Comment 6 tim.ahrentlov 2015-01-29 03:33:20 UTC
It no longer closes when tilting device.

It still closes when rotating the device. This is not how some of the premier apps out there functions.
Comment 7 Alfred R. Baudisch 2015-01-29 11:31:51 UTC
I can confirm the exactly same issue. In a portrait only application if I rotate it in the simulator the menu closes.

In the device if you make a slightly movement the menu closes as well.

Video: https://dl.dropboxusercontent.com/u/11453596/Videos/DrawerClosesAutomatically.mov
Comment 8 Alfred R. Baudisch 2015-01-29 11:49:30 UTC
I just found a workaround:

- Set target to iOS 8+.

- Put the following code in your AppDelegate. Notice that it only worked setting the AppDelegate as a WeakDelegate for the accelerometer:

var accelerometer = UIAccelerometer.SharedAccelerometer;
accelerometer.WeakDelegate = this;
accelerometer.UpdateInterval = 0f;

public void DidAccelerate(UIAccelerometer accelerometer, UIAcceleration acceleration)
Comment 9 Jason Smith [MSFT] 2015-02-02 01:58:51 UTC
Our current expected behavior is the Master is closed on rotation IF the page MasterBehavior allows it to be closed in the new state. We may visit the idea of an API to enable configuration of this behavior, currently if you wish to re-open the page just set IsPresented back to true.
Comment 10 Ian Geoghegan 2015-03-12 13:19:22 UTC

I only have portrait mode enabled and my MasterBehavior is set to MasterBehavior.Default at the end of the Master. Is the Nav collapsing the expected behavior in this case?
Comment 11 Ian Geoghegan 2015-03-12 13:38:21 UTC

Where did you put the three lines setting the AppDelegate as a WeakDelegate for the accelerometer? I tried a constructor for the AppDelegate and my override of FinishedLaunching to no effect. My deployment target is set to 8.1.