Bug 24314 - setting MasterDetailPage.IsPresented = false does nothing in iPad
Summary: setting MasterDetailPage.IsPresented = false does nothing in iPad
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.3
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-11-06 14:56 UTC by josea
Modified: 2016-03-25 18:12 UTC (History)
8 users (show)

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

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 josea 2014-11-06 14:56:07 UTC
Setting the MasterDetailPage.IsPresented = false is ignored in an iPad in Landscape.

This is already a uservoice entry (link below), but I believe this is an actual bug, not a feature request (the feature is already there - it just doesn't work).

A sample project that should work (but doesn't): https://github.com/perpetual-mobile/FormsMenuIcon.

Please note that Xamarin provides a recipe (http://developer.xamarin.com/recipes/ios/content_controls/split_view/use_split_view_to_show_two_controllers/) that demostrates that this is possible in an iPad. Take that recipe and modify the delegate for the SplitViewController to: 
			ShouldHideViewController = (svc, viewController, inOrientation) => {
				return true;
			};

That makes the Master view invisible (which is the desired result).



https://xamarin.uservoice.com/forums/258559-xamarin-forms-suggestions/suggestions/6196777-hide-the-master-page-of-a-masterdetailpage-in-land
Comment 1 Parmendra Kumar 2014-11-07 07:35:05 UTC
I have checked this issue and I am also getting same behavior mentioned in the bug description as "MasterDetailPage.IsPresented = false does nothing in iPad", I have followed the attached project in Bug description.

Screencast:http://www.screencast.com/t/B9n4iGNH
IDE Log:https://gist.github.com/Parmendrak/7f0cbcfeb0001aa8256d
Output Log:https://gist.github.com/Parmendrak/12b3501b238af12fa2e6

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 2 Kraig Spear 2015-01-03 06:58:15 UTC
Certain hacks (forcing rotation ext...) that worked before iOS 8, might no longer work. 

A possible solution is to take the phone implementation, and use on the iPad as well. 

If you replace the tablet renderer with phone, the behavior is as expected. 
A new problem is that the width is too large, and there doesn't seem to be a way to control it. 

This would probably be a breaking change in that UISpitViewController would no longer be used and is equally awkward now that UISplitViewController is supported on Phone/Compact. 

You could make the argument that it should be the same renderer one way or the other, but it also seems that the way UISplitViewController works is not consistent in what is expected in the MasterDetail implementation.
Comment 3 Kraig Spear 2015-01-03 07:05:07 UTC
The suggested fix by josea@pstaff.net did work in iOS 7, but is no longer working in iOS 8.

In order to force ShouldHideViewController to be called (deprecated in iOS 8) 

willRotate, didRotate, layout ext.... was being called to trick the VC into checking ShouldHideViewController and perform the layout. 

This no longer works (at least for me)
Comment 4 Kraig Spear 2015-01-03 07:05:34 UTC
The suggested fix by josea@pstaff.net did work in iOS 7, but is no longer working in iOS 8.

In order to force ShouldHideViewController to be called (deprecated in iOS 8) 

willRotate, didRotate, layout ext.... was being called to trick the VC into checking ShouldHideViewController and perform the layout. 

This no longer works (at least for me)
Comment 5 Jason Smith [MSFT] 2015-02-05 06:04:35 UTC
This is fixed in 1.3.2
Comment 6 josea 2015-02-06 13:28:12 UTC
Just tested  in 1.3.36321-pre2. This is NOT fixed. 

The master view is still show regardless the IsPresented value when the iPad is landscape (iOS 8.1.2).
Comment 7 Rui Marinho 2015-05-28 04:46:24 UTC
Hi Josea, if you set the MasterBehavior to be PopOver it will be possible to hide the master in Landscape do you want to try that?
Comment 8 richard.rooks 2015-07-27 11:35:04 UTC
The popover suggestion fixed my problem as it wasn't working in 1.4.3.xxxx
Comment 9 Rajneesh Kumar 2015-07-27 13:23:32 UTC
I have checked this issue with attached sample project and I am still getting same behavior with XF 1.4.4.6379-pre3 as mentioned in bug description.

Screencast: http://www.screencast.com/t/omwTXLm0

Thanks!!
Comment 10 Jason Smith [MSFT] 2016-03-25 18:12:09 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