コード例 #1
0
        public void LayoutStep()
        {
            var layout = StartFlowLayout(LinearLayoutDirection.TopBottom, LinearLayoutDirection.LeftRight);

            layout.LayoutStep = 10;
            layout.FlowStep   = 5;
            layout.Add(new LayoutParams(view1));
            layout.Add(new LayoutParams(view2));
            layout.Add(new LayoutParams(view3));
            builder.Layout();
            AreEqualRectangles(new RectangleF(0, 0, 20, 30), view1.Frame);
            AreEqualRectangles(new RectangleF(0, 40, 20, 20), view2.Frame);
            AreEqualRectangles(new RectangleF(25, 0, 100, 100), view3.Frame);
        }
コード例 #2
0
        public void LayoutBounds()
        {
            var nonZeroBounds = new RectangleF(20, 30, 100, 100);

            builder = new LayoutBuilder(nonZeroBounds);
            var layout = StartFlowLayout(LinearLayoutDirection.TopBottom);

            layout.Add(new LayoutParams(view1));
            layout.Add(new LayoutParams(view2));
            builder.Layout();
            AreEqualRectangles(new RectangleF(20, 30, 20, 30), view1.Frame);
            AreEqualRectangles(new RectangleF(20, 60, 20, 20), view2.Frame);
        }