2012-08-09 18 views
3

我可能失去了一些東西,但是這個代碼:如何使用MonoTouch.Dialog的ActivityElement?

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 
}; 

不顯示任何動畫啄。它只顯示標籤。我怎樣才能獲得動畫明星?

回答

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 2013-03-24 17:01:44

+0

啊是的。您需要將其更改爲現在使用邊界 - MT.D中有幾個位置假定爲全屏,並在iPad上失敗。 – 2013-04-26 10:15:55