3
我有一個簡單的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();
};
}
}
我讀了一些其他線程,但似乎沒有任何幫助。請幫忙!謝謝!