public override void ViewDidLoad() { base.ViewDidLoad(); MyUIToolbar toolbar = new MyUIToolbar(new RectangleF(0.0f, 0.0f, this.View.Frame.Size.Width, 44.0f)); toolbar.TintColor = UIColor.White; toolbar.BarStyle = UIBarStyle.Black; toolbar.Translucent = true; var myButton = new UIBarButtonItem(":-)", UIBarButtonItemStyle.Bordered, AddBarButtonText); toolbar.Items = new UIBarButtonItem[] { myButton, new UIBarButtonItem(":-)", UIBarButtonItemStyle.Plain, AddBarButtonText), new UIBarButtonItem(":-(", UIBarButtonItemStyle.Plain, AddBarButtonText), new UIBarButtonItem(";-)", UIBarButtonItemStyle.Plain, AddBarButtonText), new UIBarButtonItem(":-P", UIBarButtonItemStyle.Plain, AddBarButtonText), new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace), new UIBarButtonItem(UIBarButtonSystemItem.Done, delegate { this.SampleText.ResignFirstResponder(); }) }; this.SampleText.KeyboardAppearance = UIKeyboardAppearance.Dark; //TODO: uncomment this if you're replacing the entire keyboard //this.SampleText.InputView = toolbar; this.SampleText.InputAccessoryView = toolbar; }
public override void ViewDidLoad() { base.ViewDidLoad (); MyUIToolbar toolbar = new MyUIToolbar (new RectangleF(0.0f, 0.0f, this.View.Frame.Size.Width, 44.0f)); toolbar.TintColor = UIColor.White; toolbar.BarStyle = UIBarStyle.Black; toolbar.Translucent = true; var myButton = new UIBarButtonItem (":-)", UIBarButtonItemStyle.Bordered, AddBarButtonText); toolbar.Items = new UIBarButtonItem[]{ myButton, new UIBarButtonItem(":-)", UIBarButtonItemStyle.Plain, AddBarButtonText), new UIBarButtonItem(":-(", UIBarButtonItemStyle.Plain, AddBarButtonText), new UIBarButtonItem(";-)", UIBarButtonItemStyle.Plain, AddBarButtonText), new UIBarButtonItem(":-P", UIBarButtonItemStyle.Plain, AddBarButtonText), new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace), new UIBarButtonItem(UIBarButtonSystemItem.Done, delegate { this.SampleText.ResignFirstResponder(); }) }; this.SampleText.KeyboardAppearance = UIKeyboardAppearance.Dark; //TODO: uncomment this if you're replacing the entire keyboard //this.SampleText.InputView = toolbar; this.SampleText.InputAccessoryView = toolbar; }