1

我想在我的 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;
4

1 回答 1

1

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

var section = new Section () { 
                HeaderView = new UIImageView (UIImage.FromFile     ("caltemplate.png")),
                FooterView = new UISwitch (new RectangleF (0, 0, 80, 30)),
            };
于 2013-04-05T12:34:24.023 回答