René,

Sorry! Just bumped into implementing this in my own app, got same problem as
Shawn.  I wanted to try overriding ShouldHideViewController to my
UISplitViewDelegate class like you recommanded and than I realized that
UISplitViewControllerDelegate does not seems to implement the
ShouldHideViewController interface(
http://docs.go-mono.com/index.aspx?link=C%3AMonoTouch.UIKit.UISplitViewContr
ollerDelegate ).  Am I missing something obvious?

Thanks

Jean

-----Original Message-----
From: monotouch-boun...@lists.ximian.com
[mailto:monotouch-boun...@lists.ximian.com] On Behalf Of René Ruppert
Sent: October-28-2011 4:40 PM
To: 'Shawn Baker'; monotouch@lists.ximian.com
Subject: Re: [MonoTouch] ShouldHideViewController not being called

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-boun...@lists.ximian.com
[mailto:monotouch-boun...@lists.ximian.com] Im Auftrag von Shawn Baker
Gesendet: Freitag, 28. Oktober 2011 18:57
An: monotouch@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@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch

_______________________________________________
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch

_______________________________________________
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to