Bug 24114 - MasterDetail Page Issue Changing Orientation while a Modal Page is displayed
Summary: MasterDetail Page Issue Changing Orientation while a Modal Page is displayed
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.0
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-10-28 15:11 UTC by cdetera@computronsoftware.com
Modified: 2016-03-25 18:07 UTC (History)
5 users (show)

Tags: AC modal masterdetailpage
Is this bug a regression?: ---
Last known good build:


Attachments
Images described in the bug report (2.04 MB, application/x-zip-compressed)
2014-10-28 15:13 UTC, cdetera@computronsoftware.com
Details
Sample Project to Replicated the Issue (3.73 MB, application/x-zip-compressed)
2014-11-03 12:50 UTC, cdetera@computronsoftware.com
Details


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:
Status:
RESOLVED FIXED

Description cdetera@computronsoftware.com 2014-10-28 15:11:43 UTC
Since I did not get any reaction thru the Forum I figured that officially reporting this here can bring attention to this issue.

I have a Master-Detail Page application. Running it in iOS 8.0 Simulator, I started in portrait with the Master Page NOT showing (you can hide/show the Master when in portrait). Tapping on a button on the Detail Page I do a PushModalAsync on another Page. While the modal page is displayed, I change the orientation of the device to landscape and then close the modal page. This results to the Master (in landscape the Master is always displayed at least in iOS from my understanding) being just all white/blank. Going to portrait and then back to landscape again displays the contents of my Master Page.

Please note that the supposedly space for the Master is visible - just a white space on the left. I tried forcing the IsPresented to true but did not work. I tried setting it to false first then to true and it shows the Master. The problem is clicking on the Detail the Master turns to white again. Had to change the device orientation to Portrait then Landscape again as my previous post to make it work correctly. Very annoying.

Attached images here to better explain this... 1.png shows the app in portrait, 2.png show the modal page, 3.png is the result of switching to landscape and then dismissing the modal page.

Continuing on, I switched to portrait and then back to landscape. This fixes the UI as seen on 4.png. I then performed an action that displayed a modal page, switched to portrait and landscape and then dismissed the modal page. This resulted to 5.png where the Master is top of the Detail (portrait behavior) where it should be that when in the landscape the Master pushes the Detail to the right as seen in 7.png. Now, tapping on the Detail (from 5.png) resulted to 6.png where the Master hides (again, on landscape the Master is supposedly always visible). Also, note that at this state you cannot swipe from the left edge of the device to right to get the Master to come up (must be thinking that "I am in landscape so the the Master is always displayed."). Again, to get the Master back, I have to switch to portrait and then back to landscape again as you can see in 7.png. Looks like when a modal page is displayed switching orientation screws up the MasterDetail page.

For some reason I cannot add multiple attachments here so I had to Zip the images.  In case the attached file is inaccessible please refer to my post in the forum on this - http://forums.xamarin.com/discussion/26642/masterdetail-page-change-orientation-issue#latest

Thanks!
Comment 1 cdetera@computronsoftware.com 2014-10-28 15:13:07 UTC
Created attachment 8534 [details]
Images described in the bug report
Comment 2 Parmendra Kumar 2014-11-03 10:12:32 UTC
I have checked this issue but I am not able to reproduce this issue. Could you Please provide us sample project and build info that can be helpful to reproduce at my end. 

Build Info: Xamarin Studio-> About Xamarin Studio->Show Details->Copy Information
Comment 3 cdetera@computronsoftware.com 2014-11-03 12:50:27 UTC
Created attachment 8604 [details]
Sample Project to Replicated the Issue
Comment 4 cdetera@computronsoftware.com 2014-11-03 13:17:44 UTC
Parmendra Kumar,

Please see the attached project to replicated the issue. I had to build you this since I cannot ship my source code to you.  It was a good exercise though since I think I found the culprit - I am setting the IsPresented property via code.  If you look at the Views/MasterDetailDemoPage.cs in the project I've attached there is an OnAppearing override with the IsPresented being set to true:

        protected override async void OnAppearing()
        {
            base.OnAppearing();

            // if this is commented off everything works fine!!!
            this.IsPresented = true;
        }

If that code is commented off the app works properly.  I need that code though since I wanted the the Master Page visible when I come into the application so I still need a fix for this.  Please note that what is in my actual application is more complicated than this sample.

So, to replicated the issue please follow these steps religiously:
1. Simulator in Portrait.  Run the application.  The Master is displayed.
2. Click on the Detail Page. The Master Page disappears.
3.  Just below the heading (Aqua) there is a button that says "Open Modal Page...".  Click on the button.  A Modal Page is displayed whose only content is a button that says "Close".  DO NOT DO ANYTHING ON THE PAGE
4. Change the orientation of the Simulator to Landscape. 
5. Click on the Close button.  THIS IS THE BUG!  There is a white space on the left of the screen which is where the Master Page should be.
6. Change the orientation to Portrait.
7. Change the orientation to Landscape.  The Master page is now correctly displayed which is how it should be on Step 5.  Also notice that the Master Page pushed the Detail Page to the right (instead of it appearing to be on top of the detail page). This is how it should be... The Master Page cannot be hidden when in Landscape.
8. Now to continue on to the next symptom... Click on the "Open Modal Page..." button again.  This displays the page again with the Close button.
9. Change orientation to Portrait.
10. Change orientation to Landscape.
11. Click on the Close button.  Now, although the Master is displayed, didn't push the Detail to the right and appears to be on top of the Detail.  Well it is actually.  If you click on the Detail Page the Master disappears which it shouldn't do at landscape.  Also, note that swiping from the left edge doesn't display the Master.  You will have to change your orientation to Portrait and then back to Landscape again to display the Master correctly.

Please update me on this as soon as you can.  Thanks!
Comment 5 cdetera@computronsoftware.com 2014-11-03 13:21:17 UTC
I am using Visual Studio 2013 of the Xamarin components and here's the info:

Xamarin   3.7.248.0 (8ca7d11db8a6f874c6cd2de6d9ca0f511867ce91)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.18.1.3 (5474129af31e9d3a86cb7482c7c5c7a30ad315f1)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.4.0.0 (209abebbd8f1a292d042420edb45fa5fbd3f017b)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 6 cdetera@computronsoftware.com 2014-11-03 14:01:13 UTC
Loaded the project in Xamarin Studio on my McBook Pro and behaves the same.  Here's the Xamarin Studio info:

=== Xamarin Studio ===

Version 5.5.3 (build 6)
Installation UUID: c0aee4bd-dce6-4aa2-809e-871476fa138c
Runtime:
	Mono 3.10.0 ((detached/e204655)
	GTK+ 2.24.23 (Raleigh theme)
	Package version: 310000023

=== Apple Developer Tools ===

Xcode 6.0.1 (6528)
Build 6A317

=== Xamarin.iOS ===

Version: 8.4.0.16 (Business Edition)
Hash: 80e9ff7
Branch:
Build date: 2014-10-22 15:09:12-0400


=== Xamarin.Android ===

Version: 4.18.1 (Business Edition)
Android SDK: /Users/Carlo/Library/Developer/Xamarin/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.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)
		4.5    (API level 21)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Xamarin.Mac ===

Version:

=== Build Information ===

Release ID: 505030006
Git revision: fbe3e9453daf6a3bb9a9709ed22bec35f7c9056b
Build date: 2014-10-23 13:08:38-04
Xamarin addins: e44add2b39de4dd57c0742bb2e620dfad84c64c6

=== Operating System ===

Mac OS X 10.9.5
Darwin CARLOS-IMAC.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 7 cdetera@computronsoftware.com 2014-11-03 14:51:20 UTC
I am planning of updating my Mac to Yosemite and XCode 6.1 sometime this week.  Been putting it off due to the issues I've read on the forums and wanted to get a feedback from you guys on this issue.

As far as XCode 6.1 is concerned I had an issue with it when it comes to displaying Office docs, images and PDFs using WebView.  They just don't display with 6.1/Simulator iPad Retina 8.1.  Downgrading to 6.0.1/Simulator  iPad Retina 8.0 it works fine.  Cannot verify on actual device as with this issue at the moment.
Comment 8 cdetera@computronsoftware.com 2014-11-03 17:20:45 UTC
Upgraded my XCode to 6.1 and the same behavior.
Comment 9 Parmendra Kumar 2014-11-04 07:47:21 UTC
Hello @cdetera,
I have checked this issue and I have followed steps mentioned in comment #4, I have observed that the MasterDetail page has Issue when changing orientation.
Please checked the screencast and let me know if you getting same issue or I have missed anything.

Screencast:http://www.screencast.com/t/enlxxxt9W7s
Application Output:https://gist.github.com/Parmendrak/5d08c372273b3a99d0d2
IDE Log:https://gist.github.com/Parmendrak/5e85b061b93a41890582

Environment Info:
=== Xamarin Studio ===

Version 5.5.3 (build 6)
Installation UUID: 1a096c6f-0678-402e-89b2-a2c10f7e80e4
Runtime:
	Mono 3.10.0 ((detached/e204655)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000023

=== Apple Developer Tools ===

Xcode 6.1 (6602)
Build 6A1052c

=== Xamarin.iOS ===

Version: 8.4.0.16 (Business Edition)
Hash: 80e9ff7
Branch: 
Build date: 2014-10-22 15:09:12-0400

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Xamarin.Android ===

Version: 4.18.1 (Business Edition)
Android SDK: /Users/360_macmini/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)
		3.2    (API level 13)
		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)
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)



=== Operating System ===

Mac OS X 10.9.4
Darwin ShrutiMac.local 13.3.0 Darwin Kernel Version 13.3.0
    Tue Jun  3 21:27:35 PDT 2014
    root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Comment 10 cdetera@computronsoftware.com 2014-11-04 10:13:51 UTC
Parmendra Kumar,

Close (another symptom of the issue) but you didn't really follow the steps that I suggested on Comment4.  If you did follow my instructions/steps to the letter the issue I am reporting is worse and more obvious than what you were seeing.

I also suggest going for an iPad Retina Simulator since it will give you a better sized display making the issue more obvious.

As I mentioned, the result of steps 1-5 is too obvious - leaving a white space on the left of the screen where the Master Page should have been (Master Page is not visible but the space is allocated for it).  What you did in the video was close the modal page BEFORE going to landscape while I clearly stated (I hope) in the steps otherwise.

On steps 6-11 it takes looking at the display to see the issue.  On landscape mode the Master Page should is always be present (cannot be hidden) and the display should appear that the Detail page is pushed by the Master to the right.  As mentioned, after step 11 you will notice that the Master is on top of the Detail.  If you click on the Detail at this point you can't show it back by swiping from left side of the screen to right.  You can only get it back by switching to Portrait and back to Landscape again where after that you will NOT be able to hide it as it should be and the Master appears to have pushed the Detail to right instead of being on top of it.

Hope this clears up things.  Yes, your screencast do show another symptom of the bug but I believe my suggested steps give you a more obvious view of it and will definitely be noticed by the app's end user.

Thanks!
Comment 11 Parmendra Kumar 2014-11-04 12:27:30 UTC
I have checked this issue with comment#4 and comment #10, And I am also getting same behavior as mentioned in comment#4. So I am going to confirm this issue.

Screencast:http://www.screencast.com/t/yK2v0NoYe
IDE Log:https://gist.github.com/Parmendrak/7be020b44700b6a21fd0
Application Output:https://gist.github.com/Parmendrak/5ab0d72ed8c7ae2664d4

Environment Info:
=== Xamarin Studio ===

Version 5.5.3 (build 6)
Installation UUID: 1a096c6f-0678-402e-89b2-a2c10f7e80e4
Runtime:
	Mono 3.10.0 ((detached/e204655)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000023

=== Apple Developer Tools ===

Xcode 6.1 (6602)
Build 6A1052c

=== Xamarin.iOS ===

Version: 8.4.0.16 (Business Edition)
Hash: 80e9ff7
Branch: 
Build date: 2014-10-22 15:09:12-0400

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Xamarin.Android ===

Version: 4.18.1 (Business Edition)
Android SDK: /Users/360_macmini/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)
		3.2    (API level 13)
		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)
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)

=== Build Information ===

Release ID: 505030006
Git revision: fbe3e9453daf6a3bb9a9709ed22bec35f7c9056b
Build date: 2014-10-23 13:08:38-04
Xamarin addins: e44add2b39de4dd57c0742bb2e620dfad84c64c6

=== Operating System ===

Mac OS X 10.9.4
Darwin ShrutiMac.local 13.3.0 Darwin Kernel Version 13.3.0
    Tue Jun  3 21:27:35 PDT 2014
    root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Comment 12 cdetera@computronsoftware.com 2014-11-04 12:33:58 UTC
Thanks.  Is this going to R&D now that it is confirmed?  Please keep me posted on this as it is something crucial and required in the application that I am developing.
Comment 13 Jason Smith [MSFT] 2016-03-25 18:07:37 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we no longer believe it affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
 
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team