我有一個自定義按鈕,它從UIButton繼承。我正在處理TouchUpInside事件,並希望在當前視圖的頂部顯示視圖。像Windows開發中的對話框一樣有這樣的事情嗎?或者我應該以另一種方式做到這一點?從自定義控件中顯示新視圖
[MonoTouch.Foundation.Register("HRPicker")]
public class HRPicker : UIButton
{
public HRPicker() : base()
{
SetUp();
}
public HRPicker(NSCoder coder) : base(coder)
{
SetUp();
}
public HRPicker(NSObjectFlag t) : base(t)
{
SetUp();
}
public HRPicker(IntPtr handle) : base(handle)
{
SetUp();
}
public HRPicker(RectangleF frame) : base(frame)
{
SetUp();
}
public void SetUp()
{
TouchUpInside += HandleTouchUpInside;
}
void HandleTouchUpInside (object sender, EventArgs e)
{
//I want to display a View here on top of the current one.
}
}
感謝,
UIPopoverController是我需要的! –