public void DrawElementView(RectangleF rect, CGContext context, UITableViewElementCell cell) { context.SaveState(); float r = 0; float g = 0; float b = 0; var gradient = new CGGradient(CGColorSpace.CreateDeviceRGB(), new float[] { r, g, b, 0.20f, r, g, b, 0.40f }, new float[] { 0, 1 }); context.DrawLinearGradient(gradient, new PointF(rect.Left, rect.Top), new PointF(rect.Left, rect.Bottom), CGGradientDrawingOptions.DrawsBeforeStartLocation); context.RestoreState(); }
public void DrawElementView(RectangleF rect, CGContext context, UITableViewElementCell cell) { context.SaveState(); var backgroundColor = CellBackgroundColor; if (backgroundColor != null) { if (backgroundColor == UIColor.Clear) backgroundColor = UIColor.Brown; context.SetFillColorWithColor(backgroundColor.ColorWithAlpha(0.6f).CGColor); context.SetBlendMode(CGBlendMode.Overlay); context.FillRect(rect); } context.RestoreState(); }
public void DrawElementView(RectangleF rect, CGContext context, UITableViewElementCell cell) { var gradientFrame = rect; var shineFrame = gradientFrame; shineFrame.Y += 1; shineFrame.X += 1; shineFrame.Width -= 2; shineFrame.Height = (shineFrame.Height / 2); CGColorSpace colorSpace = CGColorSpace.CreateDeviceRGB(); var gradient = new CGGradient( colorSpace, new float[] { 0f, 0f,0f, 0.70f, 0f, 0f, 0f, 0.40f}, new float[] { 0, 1 } ); var shineGradient = new CGGradient( colorSpace, new float[] { 1f, 1f, 1f, 0.80f, 1f, 1f, 1f, 0.10f}, new float[] { 0, 1 } ); if (Cell != null && Cell.Highlighted) { context.SetFillColorWithColor(HighlightColor.CGColor); } else { context.SetFillColorWithColor(CellBackgroundColor.CGColor); } context.FillRect(rect); context.DrawLinearGradient(gradient, new PointF(gradientFrame.Left, gradientFrame.Top), new PointF(gradientFrame.Left, gradientFrame.Bottom), CGGradientDrawingOptions.DrawsAfterEndLocation); context.DrawLinearGradient(shineGradient, new PointF(shineFrame.Left, shineFrame.Top), new PointF(shineFrame.Left, shineFrame.Bottom), CGGradientDrawingOptions.DrawsAfterEndLocation); }
public void DrawElementView(RectangleF rect, CGContext context, UITableViewElementCell cell) { CellBackgroundColor.SetFill(); context.FillRect(rect); }
public void DrawElementView(RectangleF rect, CGContext context, UITableViewElementCell cell) { context.DrawLinearGradient(gradient, new PointF(rect.Left, rect.Top), new PointF(rect.Left, rect.Bottom), CGGradientDrawingOptions.DrawsBeforeStartLocation); cell.ShouldDrawBorder = true; }
public DisabledCellView(UITableViewElementCell cell) : base(cell.Bounds) { BackgroundColor = UIColor.Clear; Opaque = false; if(cell != null) { _Cell = cell; cell.TextLabel.TextColor = UIColor.Gray; Bounds = _Cell.CalculateInnerRect(); } }
public UITableViewCellContentView(UITableViewElementCell cell) : base(cell.Bounds) { Cell = cell; Opaque = false; }
protected void SetVisible(UITableViewElementCell cell) { if (cell != null) { if (Section != null) { if (_Visible && !Section.Elements.Contains(this)) Section.Insert(_OldRow, this); else { _OldRow = IndexPath.Row; Section.Remove(this); } } cell.SetNeedsDisplay(); } }
protected void SetDisabled(UITableViewElementCell cell) { if (cell != null) { if (_DisabledCellView != null) { _DisabledCellView.RemoveFromSuperview(); _DisabledCellView.Dispose(); _DisabledCellView = null; } _DisabledCellView = new DisabledCellView(cell); cell.AddSubview(_DisabledCellView); cell.SetNeedsDisplay(); } }
public virtual UITableViewElementCell NewCell() { var cell = new UITableViewElementCell(Theme.CellStyle, Id, this); cell.Element = this; return cell; }
protected UITableViewCell NewCell(string cellId, NSIndexPath indexPath) { var element = GetElement(indexPath); if (element == null) element = Root; var cellStyle = UITableViewCellStyle.Subtitle; var cell = new UITableViewElementCell(cellStyle, cellId, element) { IndexPath = indexPath }; return cell; }
private void InitializePropertiesFromCell(UITableViewElementCell cell) { if (cell != null) { _Cell = cell; if (Cell.Accessory != UITableViewCellAccessory.None && Accessory == UITableViewCellAccessory.None) Accessory = Cell.Accessory; if (Cell.ImageView != null && CellImageIcon == null) CellImageIcon = Cell.ImageView.Image; if (cell.TextLabel != null) { if (cell.TextLabel.Font.PointSize > 0) TextFont = cell.TextLabel.Font; TextAlignment = cell.TextLabel.TextAlignment; TextColor = cell.TextLabel.TextColor; TextShadowOffset = cell.TextLabel.ShadowOffset; if (cell.TextLabel.ShadowColor != null) TextShadowColor = cell.TextLabel.ShadowColor; } if (cell.DetailTextLabel != null) { if (cell.DetailTextLabel.Font.PointSize > 0) DetailTextFont = cell.DetailTextLabel.Font; DetailTextAlignment = cell.DetailTextLabel.TextAlignment; DetailTextColor = cell.DetailTextLabel.TextColor; DetailTextShadowOffset = cell.DetailTextLabel.ShadowOffset; if (cell.DetailTextLabel.ShadowColor != null) DetailTextShadowColor = cell.DetailTextLabel.ShadowColor; } Cell.SetNeedsDisplay(); } }
protected void SetVisible(UITableViewElementCell cell) { if (cell != null) { cell.Hidden = !_Visible; cell.TableView.SetNeedsDisplay(); } }