Esempio n. 1
0
        /// <summary>
        /// Creates a Grid that aligns inner_view horizontally and vertically
        /// as specified within the bounds of outerRect. This is useful when
        /// you are not nesting innerView in a larger layout.
        /// </summary>
        /// <seealso cref="CreateAutoCenterGrid"/>
        public static Grid CreateAlignmentGrid(UIView innerView, CGRect outerRect,
                                               Layout.Alignment horizAlignment, Layout.Alignment verticalAlignment)
        {
            var layout = new Layout().WithColumns((float)outerRect.Width).WithRows((float)outerRect.Height)
                         + innerView.At(0, 0).Horizontally(horizAlignment).Vertically(verticalAlignment).Tag("AlignmentGrid");
            var grid = new Grid(layout);

            grid.Frame = outerRect;
            return(grid);
        }