【问题标题】:Styling headers on a DialogViewControllerDialogViewController 上的样式标题
【发布时间】:2013-04-04 10:05:03
【问题描述】:

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

【问题讨论】:

    标签: c# xamarin.ios monotouch.dialog


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-10-16
      • 2015-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多