[MonoTouch] ShouldHideViewController not being called

René Ruppert rene.ruppert at googlemail.com
Fri Oct 28 16:40:08 EDT 2011


The method ShouldHideViewController is part of the controller's delegate,
not the controller itself.
The UISplitViewController class has a "Delegate" property, if I remember
correctly. Assign this a class that derives from
UISplitViewControllerDelegate (or whatever it was called) and in there
override ShouldHideViewController(), then it should work.

Alternatively the UISplitViewController might have an event handler -
usually, Monotouch always provides both ways.

René

-----Ursprüngliche Nachricht-----
Von: monotouch-bounces at lists.ximian.com
[mailto:monotouch-bounces at lists.ximian.com] Im Auftrag von Shawn Baker
Gesendet: Freitag, 28. Oktober 2011 18:57
An: monotouch at lists.ximian.com
Betreff: [MonoTouch] ShouldHideViewController not being called

I've been testing some of the new SDK 5.0 features, and one of the simpler
ones is the ability to show the master view in portrait mode in the
UISplitViewController. This is done by handling the ShouldHideViewController
event and returning false. I've created my own SplitViewController class,
which is derived from UISplitViewController, and overridden the
ShouldHideViewController method as follows:

public override bool ShouldHideViewController(UISplitViewController svc,
UIViewController viewController, UIInterfaceOrientation inOrientation) {
	return false;
}

However, this method doesn't get called unless I assign the weak delegate in
the constructor:

WeakDelegate = this;

Is this the way it's supposed to work?

I'm using Xcode 4.2, Mono 2.10.6, MonoTouch 5.0, MonoDevelop 2.8.1, and my
project's Deployment Target is 5.0.


--
View this message in context:
http://monotouch.2284126.n4.nabble.com/ShouldHideViewController-not-being-ca
lled-tp3948559p3948559.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
MonoTouch at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch



More information about the MonoTouch mailing list