我想建立的UIBarButtonItem我自己的專業類和我已經這樣做了:IOS xamarin派生類中重寫事件
public class myUIBarButtonItem: UIBarButtonItem {
UIImage _image { get; set;}
UIBarButtonItemStyle _style { get; set;}
string _title { get; set; }
public myUIBarButtonItem(UIImage mImage,UIBarButtonItemStyle mStyle, string mTitle)
: base()
{
_image = mImage;
_style = mStyle;
_title = mTitle;
UITextAttributes myTextAttrib = new UITextAttributes();
myTextAttrib.Font = UIFont.FromName("Arial",12);
myTextAttrib.TextColor = UIColor.FromRGB(202,185,131);
this.SetTitleTextAttributes (myTextAttrib, UIControlState.Normal);
this.Image = _image;
this.Title = _title;
}
}
我會重寫基類的事件,如點擊,我不知道如何處理。一段示例代碼也將對如何使用新事件處理程序使用該類感到欣慰。 在此先感謝。 最大