/// <summary> /// Instead of setting size based on the view's Frame, use this. /// Only used when column and/or row size is -1. /// </summary> public static Grid.Layout.Cell UseFixedSize(this Grid.Layout.Cell cell, CGSize size) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position) { UseFixedSize = true, FixedSize = size });
/// <summary> /// Instead of setting size based on the view's Frame, use this. /// Only used when column and/or row size is -1. /// </summary> public static Grid.Layout.Cell UseFixedSize(this Grid.Layout.Cell cell, nfloat w, nfloat h) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position) { UseFixedSize = true, FixedSize = new CGSize(w, h) });
internal static Grid.Layout.Cell Align(Grid.Layout.Cell cell, Grid.Layout.Alignment alignment, Grid.Layout.Direction direction) { if (direction.HasFlag(Grid.Layout.Direction.Horizontal)) { cell = cell.Horizontally(alignment); } if (direction.HasFlag(Grid.Layout.Direction.Vertical)) { cell = cell.Vertically(alignment); } return(cell); }
/// <summary> /// If the view is a UIScrollView and this is set, autosize will use /// ContentSize of the scroll view to size based on actual contained /// content. /// </summary> public static Grid.Layout.Cell UseContentSize(this Grid.Layout.Cell cell) => cell.UseContentSize(true);
/// <summary> /// If the view is a UIScrollView and this is set, autosize will use /// ContentSize of the scroll view to size based on actual contained /// content. /// </summary> public static Grid.Layout.Cell UseContentSize(this Grid.Layout.Cell cell, bool useContentSize) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position) { UseContentSize = useContentSize });
/// <summary> /// This is an alternative to using Vertically() and/or Horizontally() to set /// alignment. It sets one of both directions to Start. /// </summary> public static Grid.Layout.Cell AlignEnd(this Grid.Layout.Cell cell, Grid.Layout.Direction direction = Grid.Layout.Direction.Both) => Align(cell, Grid.Layout.Alignment.End, direction);
/// <summary> /// When set, the cell's view will not be positioned during layout nor sized. This is useful /// when the X,Y position of a sub-view is set in some other way. /// </summary> public static Grid.Layout.Cell NoPosition(this Grid.Layout.Cell cell) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position) { NoPosition = true });
public static Grid.Layout.Cell MarginLeft(this Grid.Layout.Cell cell, nfloat left) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position) { Margin = cell.Position.Margin.SetLeft(left) });
public static Grid.Layout.Cell MarginRight(this Grid.Layout.Cell cell, nfloat right) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position) { Margin = cell.Position.Margin.SetRight(right) });
/// <summary> /// Margin is included in size auto calculation (when a col or row spec is -1). /// </summary> public static Grid.Layout.Cell Margin(this Grid.Layout.Cell cell, nfloat all) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position) { Margin = new UIEdgeInsets(all, all, all, all) });
public static Grid.Layout.Cell MarginTop(this Grid.Layout.Cell cell, nfloat top) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position) { Margin = cell.Position.Margin.SetTop(top) });
public static Grid.Layout.Cell ColSpan(this Grid.Layout.Cell cell, int columnspan) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position) { ColumnSpan = columnspan });
/// <summary> /// Margin is included in size auto calculation (when a col or row spec is -1). /// </summary> public static Grid.Layout.Cell Margin(this Grid.Layout.Cell cell, nfloat top, nfloat left, nfloat bottom, nfloat right) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position) { Margin = new UIEdgeInsets(top, left, bottom, right) });
/// <summary> /// Margin is included in size auto calculation (when a col or row spec is -1). /// </summary> public static Grid.Layout.Cell Margin(this Grid.Layout.Cell cell, UIEdgeInsets margin) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position) { Margin = margin });
public static Grid.Layout.Cell Horizontally(this Grid.Layout.Cell cell, Grid.Layout.Alignment alignment) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position) { Horizontal = alignment });
public static Grid.Layout.Cell RowSpan(this Grid.Layout.Cell cell, int rowspan) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position) { RowSpan = rowspan });
/// <summary> /// This is an alternative to using Vertically() and/or Horizontally() to set /// alignment. It sets one of both directions to Stretched. /// </summary> public static Grid.Layout.Cell AlignStretch(this Grid.Layout.Cell cell, Grid.Layout.Direction direction = Grid.Layout.Direction.Both) => Align(cell, Grid.Layout.Alignment.Stretched, direction);
public static Grid.Layout.Cell MarginBottom(this Grid.Layout.Cell cell, nfloat bottom) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position) { Margin = cell.Position.Margin.SetBottom(bottom) });
/// <summary> /// If a View is Hidden or has Alpha set to 0, whether to /// skip the view when auto sizing the width and/or height. /// </summary> public static Grid.Layout.Cell CollapseHidden(this Grid.Layout.Cell cell, Grid.Layout.Collapse collapse) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position) { CollapseHidden = collapse });
/// <summary> /// Provides a way to attach a .NET value to the grid cell. Useful for debugging. /// </summary> public static Grid.Layout.Cell Tag(this Grid.Layout.Cell cell, object tag) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position) { Tag = tag });