本文整理汇总了C#中UITextView.SetNeedsDisplay方法的典型用法代码示例。如果您正苦于以下问题:C# UITextView.SetNeedsDisplay方法的具体用法?C# UITextView.SetNeedsDisplay怎么用?C# UITextView.SetNeedsDisplay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UITextView
的用法示例。
在下文中一共展示了UITextView.SetNeedsDisplay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestView
public UIViewController TestView()
{
// Create a view with a Button to run the tests and a Text View for the Results.
var vc = new UIViewController();
var btn = new UIButton(new RectangleF(0, 0, 100, 40));
btn.SetTitle("Run Tests", UIControlState.Normal);
btn.BackgroundColor = UIColor.White;
btn.SetTitleColor(UIColor.Black, UIControlState.Normal);
var textResults = new UITextView(new RectangleF(0, 50, vc.View.Bounds.Width, 40));
textResults.Text = "";
textResults.Hidden = true;
// Setup Test here
btn.TouchUpInside += (sender, e) =>
{
Console.WriteLine("Running Tests...");
textResults.Text = "Tests Running";
btn.Enabled = false;
textResults.SetNeedsDisplay();
btn.SetNeedsDisplay();
try
{
var results = RunTests();
var failed = results.Where(r => !r.Pass).ToList();
textResults.Text = failed.Count == 0 ? "All Filters Passed" : "These filters failed " + string.Join(Environment.NewLine, failed.Select (r => r.FilterName));
textResults.Hidden = false;
}
finally
{
btn.Enabled = true;
}
};
vc.View.AddSubviews(btn, textResults);
return vc;
}