I think I found the answer...I do not believe this is a bug, but feedback is welcome.
Take the code in the
To properly get this to work one needs to manually set the
Take the code in the
ExampleBrowser
for iOSprivate void GraphView(ExampleInfo exampleInfo)
{
var dvc = new GraphViewController (exampleInfo);
navigation.PushViewController (dvc, true);
}
What I was attempting to do in my app was to take a UIViewController and add it to a second UIViewController, an allowed operation I believe, by doing the followingprivate void GraphView(ExampleInfo exampleInfo)
{
var dvc = new GraphViewController (exampleInfo);
var newGraphViewController = new UIViewController ();
newGraphViewController.AddChildViewController (dvc);
newGraphViewController.View.AddSubview (dvc.View);
navigation.PushViewController (newGraphViewController, true);
}
The above produced an empty view, nothing to show on the screen. The reason is, when dvc
calls LoadView()
the View.Frame
of dvc
is 0,0,0,0
, the frame has no position and no size.To properly get this to work one needs to manually set the
View.Frame
of the child UIViewController. The following code works fine:private void GraphView(ExampleInfo exampleInfo)
{
var dvc = new GraphViewController (exampleInfo);
var newGraphViewController = new UIViewController ();
dvc.View.Frame = newGraphViewController.View.Frame;
newGraphViewController.AddChildViewController (dvc);
newGraphViewController.View.AddSubview (dvc.View);
navigation.PushViewController (newGraphViewController, true);
}
Not a bug, I believe this is as designed by iOS.