本文整理汇总了C#中MonoTouch.Dialog.RootElement.RemoveAt方法的典型用法代码示例。如果您正苦于以下问题:C# RootElement.RemoveAt方法的具体用法?C# RootElement.RemoveAt怎么用?C# RootElement.RemoveAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoTouch.Dialog.RootElement
的用法示例。
在下文中一共展示了RootElement.RemoveAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateRootElement
private RootElement CreateRootElement()
{
var captionLabel = UIHelper.CreateLabel (
"cross copy",
true,
32,
32,
UITextAlignment.Center,
UIColor.Black
);
UILabel subcaptionLabel = UIHelper.CreateLabel (
WELCOME_LABEL_TEXT,
false,
14,
85,
UITextAlignment.Center,
lightTextColor
);
subcaptionLabel.Tag = 3;
captionLabel.Frame = new Rectangle (0, 10, 320, 40);
subcaptionLabel.Frame = new Rectangle (20, 55, 280, 100);
UIView header = new UIView (new Rectangle (0, 0, 300, 145));
header.AddSubviews (captionLabel, subcaptionLabel);
var root = new RootElement ("Secrets")
{
new Section (header),
(secretsSection = new Section ("Secrets")),
new Section ()
{
(secretEntry = new AdvancedEntryElement ("Secret", "enter new phrase", "", null))
}
};
secretsSection.AddAll (from s in AppDelegate.HistoryData.Secrets select (Element)CreateImageButtonStringElement (s));
secretEntry.AutocapitalizationType = UITextAutocapitalizationType.None;
secretEntry.ShouldReturn += delegate {
if (String.IsNullOrEmpty (secretEntry.Value))
return false;
var newSecret = new Secret (secretEntry.Value);
AppDelegate.HistoryData.Secrets.Add (newSecret);
if (root.Count == 2)
root.Insert (1, secretsSection);
secretsSection.Insert (
secretsSection.Elements.Count,
UITableViewRowAnimation.Fade,
CreateImageButtonStringElement (newSecret)
);
secretEntry.Value = "";
secretEntry.ResignFirstResponder (false);
DisplaySecretDetail (newSecret);
return true;
};
secretEntry.ReturnKeyType = UIReturnKeyType.Go;
if (secretsSection.Count == 0) {
secretEntry.BecomeFirstResponder (true);
root.RemoveAt (1);
}
return root;
}