如何使用MonoTouch.Dialog的ActivityElement?

3

我可能漏掉了一些东西,但是这段代码:

this.oSectionDRs = new Section()
{
    new ActivityElement()
    {
        Caption = Locale.GetLocale("Settings_Loading"), 
        Animating = true
    }
};

// To begin with just show a loading indicator.
this.Root = new RootElement (Locale.GetLocale("Settings_Select"))
{
    this.oSectionDRs
};

不显示任何动画效果,只显示标签。如何获得动画的星星?

1个回答

0

使用以下代码:

var root = new RootElement("foo");
      root.Add (new Section("foo", "bar") {
      new ActivityElement()
      {
        Caption = "foo",
        Animating = true
      }
    });

    var dvc = new DialogViewController(root, false);


    window.RootViewController = dvc;

我同时得到了标题和活动滚动条。不确定它是否对您有帮助!我只是在使用内置的MT.D。


1
问题在于 ActivityElement 从未调整以与弹出窗口一起使用,它正在使用 UIScreen.MainScreen.Bounds 来计算其位置。这就是为什么如果它是根控制器,它会为您工作的原因。我有一个修复了该问题的示例:https://github.com/Krumelur/ReviewSelection/blob/master/ReviewSelection/UI/Elements/FixedActivityElement.cs - Krumelur
啊,是的。你需要将它改为现在使用Bounds - 在MT.D中有一些假设全屏并在iPad上失败的部分。 - Nic Wise

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接