在DialogViewController上设置标题

时间:2013-04-04 10:05:03

标签: c# xamarin.ios monotouch.dialog

我想在DialogViewController上设置标题样式。控制器的内容是从JSON响应加载的。

如何使用背景颜色等设置标题元素的样式?

string responseString = string.Empty;
        Uri uri = new Uri ("http://loca!host.com/sample.json");
        HttpWebRequest request = new HttpWebRequest (uri);
        request.Method = "GET";

        HttpWebResponse response = request.GetResponse () as HttpWebResponse;
        var obj = JsonValue.Load (new StreamReader (response.GetResponseStream())) as JsonObject;
        if (obj != null) {

            var root = JsonElement.FromJson (obj);
            _rootVC = new DialogViewController (root);


            var jsonSection = root["section-1"] as Section;

1 个答案:

答案 0 :(得分:1)

一个Section,有一个HeaderView和FooterView属性,你可以在那里设置它们。

var section = new Section () { 
                HeaderView = new UIImageView (UIImage.FromFile     ("caltemplate.png")),
                FooterView = new UISwitch (new RectangleF (0, 0, 80, 30)),
            };