I'm currently in the final process of creating a game with Monotouch (and
MonoGame). Unfortunately, I'm running in to a view strange problem. My
game utilizes only the landscape views and my project settings for both ipad
and iphone are set to Landscape only. Everything is working fine except any
external view is still displayed as if the device is in portrait, including
all of the game center views.
After a lot of research, it seems the Game Center relies on the
RootViewController of the UIWindow to determine it's orientation but in this
case, the RootViewController is null. If I set it (MT 4.0.3) to a custom
view controller then all of the Game Center views are displayed correctly.
HOWEVER, when testing on an iPad 2, I get a very large performance hitch
(50-150ms frame time). This only occurs on the iPad 2. Both an iPhone 4
and an original iPad work fine without the hitch. I'm trying to track down
what is causing the hit but so far no luck. Here is the code I'm using to
setup the window:
public class FixedUIViewController : UIViewController
{
public override bool ShouldAutorotateToInterfaceOrientation
(UIInterfaceOrientation toInterfaceOrientation)
{
return (toInterfaceOrientation ==
UIInterfaceOrientation.LandscapeLeft || toInterfaceOrientation ==
UIInterfaceOrientation.LandscapeRight);
}
}
in my Game's constructor I have the following:
_mainWindow = new UIWindow(UIScreen.MainScreen.Bounds);
_FixedViewController = new FixedUIViewController();
_mainWindow.RootViewController = _FixedViewController;
_view = new GameWindow();
_FixedViewController.Add(_view);
Any ideas would help.
--
View this message in context:
http://monotouch.2284126.n4.nabble.com/UIWindow-RootViewController-and-the-iPad-2-Oh-My-tp3612279p3612279.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch