스크롤하지 않는 헤더를 추가하려면 추가하려는 추가 뷰와 DialogViewController 뷰가 모두 포함 된 컨트롤러를 만들 수 있습니다.
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
UIWindow window;
MyDialogViewController dvc;
UIViewController container;
float labelHeight = 30;
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
container = new UIViewController();
container.View.AddSubview (new UILabel (new RectangleF (0, 0, UIScreen.MainScreen.Bounds.Width, labelHeight)){
Text = "my label", BackgroundColor = UIColor.Green});
dvc = new MyDialogViewController (labelHeight);
container.View.AddSubview (dvc.TableView);
window.RootViewController = container;
window.MakeKeyAndVisible();
return true;
}
}
그 다음 DialogViewController가있는 viewDidLoad 방법에서의 TableView의 높이를 조정한다 : 예를 들어 다음의 간단한 예는 (이 경우에는 컨테이너함) 추가 제어기 파단로 DialogViewController의 도면과 함께 UILabel의 추가
public partial class MyDialogViewController : DialogViewController
{
float labelHeight;
public MyDialogViewController (float labelHeight) : base (UITableViewStyle.Grouped, null)
{
this.labelHeight = labelHeight;
Root = new RootElement ("MyDialogViewController") {
new Section(){
new StringElement ("one"),
new StringElement ("two"),
new StringElement ("three")
}
};
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
TableView.Frame = new RectangleF (TableView.Frame.Left, TableView.Frame.Top + labelHeight, TableView.Frame.Width, TableView.Frame.Height - labelHeight);
}
}
여기 시뮬레이터의 결과를 보여주는 스크린 샷입니다 : ![enter image description here](https://i.stack.imgur.com/5oaDU.png)
우수한 예를 들어 마이크를 :) – dalexsoto