public DropDownControl(DropDownView view, nfloat fSize) : base() { this.Parent = view; UserInteractionEnabled = true; MultipleTouchEnabled = true; this._Button1 = new UIButton(); this._Button1.SetTitle(view.Title, UIControlState.Normal); this._Button1.SetTitleColor(UIColor.Black, UIControlState.Normal); this._Button1.BackgroundColor = UIColor.White; this._Button1.UserInteractionEnabled = true; this._Button1.MultipleTouchEnabled = true; if (fSize > 1) { this._Button1.Font = UIFont.SystemFontOfSize(fSize); } this._DropDownView = new UIView(); this._DropDownView.Layer.MasksToBounds = false; this._DropDownView.Layer.BorderColor = UIColor.Black.CGColor; this._DropDownView.Layer.BorderWidth = 1; this._DropDownView.BackgroundColor = UIColor.FromRGB(0, 175, 63); this._Button1.HorizontalAlignment = UIControlContentHorizontalAlignment.Left; this._Button1.TitleEdgeInsets = new UIEdgeInsets(0, 10, 0, 0); this._Button1.MultipleTouchEnabled = true; // add to view this.Add(this._Button1); this.Add(this._DropDownView); this._Button1.TouchDown += Button1Click; // handle selection SelectedText = (x) => { SetTitle(x); }; }
public DropDownControl(DropDownView view, nfloat fSize) : base() { this.Parent = view; UserInteractionEnabled = true; MultipleTouchEnabled = true; this._Button1 = new UIButton (); this._Button1.SetTitle (view.Title, UIControlState.Normal); this._Button1.SetTitleColor(UIColor.Black, UIControlState.Normal); this._Button1.BackgroundColor = UIColor.White; this._Button1.UserInteractionEnabled = true; this._Button1.MultipleTouchEnabled = true; if (fSize > 1) { this._Button1.Font = UIFont.SystemFontOfSize (fSize); } this._DropDownView = new UIView (); this._DropDownView.Layer.MasksToBounds = false; this._DropDownView.Layer.BorderColor = UIColor.Black.CGColor; this._DropDownView.Layer.BorderWidth = 1; this._DropDownView.BackgroundColor = UIColor.FromRGB (0, 175, 63); this._Button1.HorizontalAlignment = UIControlContentHorizontalAlignment.Left; this._Button1.TitleEdgeInsets = new UIEdgeInsets (0, 10, 0, 0); this._Button1.MultipleTouchEnabled = true; // add to view this.Add (this._Button1); this.Add (this._DropDownView); this._Button1.TouchDown += Button1Click; // handle selection SelectedText = (x) => { SetTitle(x); }; }
public DropDownViewHeader(DropDownView view, string title) { // set the parent this.Parent = view; this._headerLabel = new UILabel (); this._headerLabel.Text = title; this._headerLabel.TextColor = UIColor.White; this._ButtonClose = new UIButton (); this._ButtonClose.SetTitle ("Close", UIControlState.Normal); this._ButtonClose.BackgroundColor = UIColor.Red; this._ButtonClose.SetTitleColor (UIColor.White, UIControlState.Normal); this.Add (this._headerLabel); this.Add (this._ButtonClose); // R (0) G (70) B (172) this.BackgroundColor = UIColor.FromRGB(0, 70, 172); this.Frame = new CGRect (0, 0, 200, 20); this._ButtonClose.TouchDown += ButtonClose_TouchDown; }
public DropDownViewHeader(DropDownView view, string title) { // set the parent this.Parent = view; this._headerLabel = new UILabel(); this._headerLabel.Text = title; this._headerLabel.TextColor = UIColor.White; this._ButtonClose = new UIButton(); this._ButtonClose.SetTitle("Close", UIControlState.Normal); this._ButtonClose.BackgroundColor = UIColor.Red; this._ButtonClose.SetTitleColor(UIColor.White, UIControlState.Normal); this.Add(this._headerLabel); this.Add(this._ButtonClose); // R (0) G (70) B (172) this.BackgroundColor = UIColor.FromRGB(0, 70, 172); this.Frame = new CGRect(0, 0, 200, 20); this._ButtonClose.TouchDown += ButtonClose_TouchDown; }
public DropDownControl(DropDownView view) : this(view, 0) { }
//private UIView MainRect; public DropDownControl(DropDownView view, nfloat fSize) : base() { this.Parent = view; UserInteractionEnabled = true; MultipleTouchEnabled = true; this._Button1 = new UIButton(); this._Button1.SetTitle(view.Title, UIControlState.Normal); this._Button1.SetTitleColor(UIColor.Black, UIControlState.Normal); this._Button1.BackgroundColor = UIColor.White; this._Button1.UserInteractionEnabled = true; this._Button1.MultipleTouchEnabled = true; if (fSize > 1) { this._Button1.Font = UIFont.SystemFontOfSize(fSize); } this._DropDownView = new UIView(); this._DropDownView.Layer.MasksToBounds = false; // this._DropDownView.Layer.BorderColor = UIColor.Clear.CGColor; // this._DropDownView.Layer.CornerRadius = 4; // this._DropDownView.Layer.BorderWidth = 1; // this._DropDownView.AddBorder (UIRectEdge.Left, UIColor.Black, 1); this._DropDownView.BackgroundColor = UIColor.Clear; this._DropDownView.Layer.BackgroundColor = UIColor.Clear.CGColor; // = UIColor.FromRGB (0, 175, 63).CGColor; this._Button1.HorizontalAlignment = UIControlContentHorizontalAlignment.Left; this._Button1.TitleEdgeInsets = new UIEdgeInsets(0, 10, 0, 0); this._Button1.MultipleTouchEnabled = true; // add to view //this.Add (this._Button1); //this.Add (this._DropDownView); //MainRect = new UIView (); this.AddSubview(this._Button1); var top = UIApplication.SharedApplication.KeyWindow.RootViewController; // var v = top.View; // v.MultipleTouchEnabled = true; top.Add(_DropDownView); //this.AddSubview (this._DropDownView); //this.MainRect.BackgroundColor = UIColor.Yellow; this._Button1.TouchDown += Button1Click; // handle selection SelectedText = (x) => { SetTitle(x); }; // // this.BackgroundColor = UIColor.Clear; this.Layer.BorderColor = UIColor.Blue.CGColor; this.Layer.BackgroundColor = UIColor.Green.CGColor; this.Layer.BorderWidth = 1; this.Layer.CornerRadius = 4; }
//private UIView MainRect; public DropDownControl(DropDownView view, nfloat fSize) : base() { this.Parent = view; UserInteractionEnabled = true; MultipleTouchEnabled = true; this._Button1 = new UIButton (); this._Button1.SetTitle (view.Title, UIControlState.Normal); this._Button1.SetTitleColor(UIColor.Black, UIControlState.Normal); this._Button1.BackgroundColor = UIColor.White; this._Button1.UserInteractionEnabled = true; this._Button1.MultipleTouchEnabled = true; if (fSize > 1) { this._Button1.Font = UIFont.SystemFontOfSize (fSize); } this._DropDownView = new UIView (); this._DropDownView.Layer.MasksToBounds = false; // this._DropDownView.Layer.BorderColor = UIColor.Clear.CGColor; // this._DropDownView.Layer.CornerRadius = 4; // this._DropDownView.Layer.BorderWidth = 1; // this._DropDownView.AddBorder (UIRectEdge.Left, UIColor.Black, 1); this._DropDownView.BackgroundColor = UIColor.Clear; this._DropDownView.Layer.BackgroundColor = UIColor.Clear.CGColor; // = UIColor.FromRGB (0, 175, 63).CGColor; this._Button1.HorizontalAlignment = UIControlContentHorizontalAlignment.Left; this._Button1.TitleEdgeInsets = new UIEdgeInsets (0, 10, 0, 0); this._Button1.MultipleTouchEnabled = true; // add to view //this.Add (this._Button1); //this.Add (this._DropDownView); //MainRect = new UIView (); this.AddSubview (this._Button1); var top = UIApplication.SharedApplication.KeyWindow.RootViewController; // var v = top.View; // v.MultipleTouchEnabled = true; top.Add (_DropDownView); //this.AddSubview (this._DropDownView); //this.MainRect.BackgroundColor = UIColor.Yellow; this._Button1.TouchDown += Button1Click; // handle selection SelectedText = (x) => { SetTitle(x); }; // // this.BackgroundColor = UIColor.Clear; this.Layer.BorderColor = UIColor.Blue.CGColor; this.Layer.BackgroundColor = UIColor.Green.CGColor; this.Layer.BorderWidth = 1; this.Layer.CornerRadius = 4; }