本文整理匯總了C#中MonoTouch.Dialog.RootElement.Clear方法的典型用法代碼示例。如果您正苦於以下問題:C# RootElement.Clear方法的具體用法?C# RootElement.Clear怎麽用?C# RootElement.Clear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MonoTouch.Dialog.RootElement
的用法示例。
在下文中一共展示了RootElement.Clear方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: PopulateData
/// <summary>
/// This could get called from main thread or background thread.
/// Remember to InvokeOnMainThread if required
/// </summary>
void PopulateData()
{
if (TwitterFeed.Count == 0) {
var section = new Section ("Network unavailable") {
new StyledStringElement ("Twitter not available. Try again later.")
};
Root = new RootElement ("Twitter") { section };
} else {
Section section;
UI.CustomElements.TweetElement twitterElement;
// create a root element and a new section (MT.D requires at least one)
Root = new RootElement ("Twitter");
section = new Section();
// for each tweet, add a custom TweetElement to the MT.D elements collection
foreach (var tw in TwitterFeed) {
var currentTweet = tw;
twitterElement = new UI.CustomElements.TweetElement (currentTweet, splitView);
section.Add (twitterElement);
}
Root.Clear ();
// add the section to the root
Root.Add(section);
}
base.StopLoadingScreen(); // hide the 'loading' animation (from base)
ReloadComplete ();
}