Ios 如何将MonoTouch.Dialog元素嵌入ViewController?
我正在尝试使用这个: 我可以看到视图元素,当我这样做。。。但是,单击其中一个单选元素不会执行任何操作(例如,显示复选框)。不知道我做错了什么 下面是我在ViewDidLoad()中使用的代码Ios 如何将MonoTouch.Dialog元素嵌入ViewController?,ios,xamarin.ios,monotouch.dialog,radioelement,Ios,Xamarin.ios,Monotouch.dialog,Radioelement,我正在尝试使用这个: 我可以看到视图元素,当我这样做。。。但是,单击其中一个单选元素不会执行任何操作(例如,显示复选框)。不知道我做错了什么 下面是我在ViewDidLoad()中使用的代码 我发现对话框控制器扩展到viewcontroller的边缘时出现问题 解决方案是添加一个中间UIView作为容器,以强制DialogController保持在正确的边界内 正确的代码是: var rootElement = new RootElement("Question Text", new Radi
我发现对话框控制器扩展到viewcontroller的边缘时出现问题 解决方案是添加一个中间UIView作为容器,以强制DialogController保持在正确的边界内 正确的代码是:
var rootElement = new RootElement("Question Text", new RadioGroup("answer", 0))
{
new Section()
{
new RadioElement("Answer A", "answer"),
new RadioElement("Answer B", "answer"),
new RadioElement("Answer C", "answer"),
new RadioElement("Answer D", "answer")
}
};
_questionDialogViewController = new DialogViewController(rootElement);
_questionDialogViewController.View.BackgroundColor = UIColor.Clear.FromHexString(AppDelegate.EventModel.MainBackgroundColor);
_questionDialogViewController.View.Frame = new RectangleF(0, 0, 964, 500);
var answerContainer = new UIView(new RectangleF(30, 150, 964, 500));
answerContainer.AddSubview(_questionDialogViewController.View);
View.AddSubview(answerContainer);
var rootElement = new RootElement("Question Text", new RadioGroup("answer", 0))
{
new Section()
{
new RadioElement("Answer A", "answer"),
new RadioElement("Answer B", "answer"),
new RadioElement("Answer C", "answer"),
new RadioElement("Answer D", "answer")
}
};
_questionDialogViewController = new DialogViewController(rootElement);
_questionDialogViewController.View.BackgroundColor = UIColor.Clear.FromHexString(AppDelegate.EventModel.MainBackgroundColor);
_questionDialogViewController.View.Frame = new RectangleF(0, 0, 964, 500);
var answerContainer = new UIView(new RectangleF(30, 150, 964, 500));
answerContainer.AddSubview(_questionDialogViewController.View);
View.AddSubview(answerContainer);