如何使用SetNeedsDisplay刷新我的UIVIewController

问题描述:

我有一个简单的UIViewController(在monotouch中),在UI上有一个按钮。现在,我的用例很简单 - 我想单击按钮时重新加载UIViewController。在我读的一些线程上,我只需要调用UIView的SetNeedsDisplay,但这似乎不适用于我。这里是我的代码片段 -如何使用SetNeedsDisplay刷新我的UIVIewController

public partial class AbcScreen : UIViewController 
{ 
.... 
    public override void ViewDidLoad() 
    { 
     base.ViewDidLoad(); 
     // Declare and Add a button 
     Add(myBtn); 
     myBtn.TouchUpInside += (sender, ea) => 
       { 
        Console.WriteLine("Touched the button"); 
        View.SetNeedsDisplay(); 
       }; 
    } 
} 

我读了一些其他线程,但似乎没有任何帮助。请帮忙!谢谢!

尝试用

this.ReloadInputViews();