Dim NaObj As NativeObject = Me
NaObj = NaObj.RunMethod("CreateViewController",Null)
Dim P As Page = NaObj
Dim V As View = NaObj.GetField("view")
Dim NaObj2 As NativeObject = Me
Dim Top As Float = NaObj2.RunMethod("yOffset2:",Array(NavControl)).AsNumber
If NavControl.NavigationBarVisible Then
Top = Top + NaObj2.RunMethod("yOffset1:",Array(NavControl)).AsNumber
End If
Dim RootPanel As Panel
RootPanel.Initialize("")
RootPanel.SetLayoutAnimated(0,1,0,Top,V.Width,V.Height)
NaObj = V
NaObj.RunMethod("addSubview:",Array(RootPanel))
NavControl.ShowPage(P)
RootPanel.Color = Colors.Green
'Now you can add views to the "RootPanel" (it's not the real root panel)
Dim lbl As Label
lbl.Initialize("")
lbl.Text = "Hello"
RootPanel.AddView(lbl,0,0,300,20)
#if OBJC
-(UIViewController *)CreateViewController{
UIViewController *ViewController = [[UIViewController alloc] init];
return ViewController;
}
-(CGFloat)yOffset1:(UINavigationController*)NC{
return NC.navigationBar.frame.size.height;
}
-(CGFloat)yOffset2:(UINavigationController*)NC{
return [[UIApplication sharedApplication] statusBarFrame].size.height;
}
#End If