/// <summary> /// Initializes a new instance of the <see cref="KSStapleMenu.KSStapleMenu"/> class. /// </summary> /// <param name="mode">defines how the menu attaches to the parent view</param> /// <param name="offset">Offset in units the menu will be indented from top or left border of parent view.</param> /// <param name="itemSize">Size of one item.</param> public KSStapleMenu(STAPLEMENU_MODE mode, float offset, SizeF itemSize) : base() { this.ItemSize = itemSize; this.Mode = mode; this.Offset = offset; switch (this.Mode) { case STAPLEMENU_MODE.Right: this.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin; break; case STAPLEMENU_MODE.Left: this.AutoresizingMask = UIViewAutoresizing.FlexibleRightMargin; break; } //this.BackgroundColor = UIColor.Cyan; }
/// <summary> /// Initializes a new instance of the <see cref="KSStapleMenu.KSStapleMenu"/> class. /// </summary> /// <param name="mode">defines how the menu attaches to the parent view</param> /// <param name="offset">Offset in units the menu will be indented from top or left border of parent view.</param> /// <param name="itemSize">Size of one item.</param> public KSStapleMenu(STAPLEMENU_MODE mode, float offset, SizeF itemSize) : base() { this.ItemSize = itemSize; this.Mode = mode; this.Offset = offset; switch(this.Mode) { case STAPLEMENU_MODE.Right : this.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin; break; case STAPLEMENU_MODE.Left : this.AutoresizingMask = UIViewAutoresizing.FlexibleRightMargin; break; } //this.BackgroundColor = UIColor.Cyan; }
/// <summary> /// Initializes a new instance of the <see cref="KSStapleMenu.KSStapleMenu"/> class. /// </summary> /// <param name="mode">defines how the menu attaches to the parent view</param> /// <param name="offset">Offset in units the menu will be indented from top or left border of parent view.</param> /// <param name="itemSize">Size of one item.</param> public KSStapleMenu(STAPLEMENU_MODE mode, float offset, SizeF itemSize) : base() { this.ItemSize = itemSize; this.Mode = mode; this.Offset = offset; switch(this.Mode) { case STAPLEMENU_MODE.Right : this.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin; break; case STAPLEMENU_MODE.Left : this.AutoresizingMask = UIViewAutoresizing.FlexibleRightMargin; break; } this.BackgroundColor = UIColor.Clear; this.blurLayer = new KSStapleMenuBlurView(this); this.blurLayer.AutoresizingMask = this.Mode == STAPLEMENU_MODE.Right ? UIViewAutoresizing.FlexibleLeftMargin : UIViewAutoresizing.FlexibleRightMargin; this.AddSubview(this.blurLayer); }
/// <summary> /// Initializes a new instance of the <see cref="KSStapleMenu.KSStapleMenu"/> class. /// </summary> /// <param name="mode">defines how the menu attaches to the parent view</param> /// <param name="offset">Offset in units the menu will be indented from top or left border of parent view.</param> /// <param name="itemSize">Size of one item.</param> public KSStapleMenu(STAPLEMENU_MODE mode, float offset, SizeF itemSize) : base() { this.ItemSize = itemSize; this.Mode = mode; this.Offset = offset; switch (this.Mode) { case STAPLEMENU_MODE.Right: this.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin; break; case STAPLEMENU_MODE.Left: this.AutoresizingMask = UIViewAutoresizing.FlexibleRightMargin; break; } this.BackgroundColor = UIColor.Clear; this.blurLayer = new KSStapleMenuBlurView(this); this.blurLayer.AutoresizingMask = this.Mode == STAPLEMENU_MODE.Right ? UIViewAutoresizing.FlexibleLeftMargin : UIViewAutoresizing.FlexibleRightMargin; this.AddSubview(this.blurLayer); }