| | |
| | | if (view is FrameRowControl || view is RowLayoutControl)
|
| | | {
|
| | | //FrameRowLayout控件的时候,直接扩大它的高度
|
| | | var tempView = this.GetChildren(this.ChildrenCount - 1);
|
| | | if (tempView != null)
|
| | | var intBottom = this.GetLocationMostLastViewBottom();
|
| | | if (intBottom != -1)
|
| | | {
|
| | | view.Y = tempView.Bottom;
|
| | | view.Y = intBottom;
|
| | | }
|
| | | base.AddChidren(view);
|
| | | if (rowSpace > 0)
|
| | |
| | | else
|
| | | {
|
| | | //非FrameRowLayout控件的时候,计算的是坐标
|
| | | var tempView = this.GetChildren(this.ChildrenCount - 1);
|
| | | if (tempView != null)
|
| | | var intBottom = this.GetLocationMostLastViewBottom();
|
| | | if (intBottom != -1)
|
| | | {
|
| | | view.Y = tempView.Bottom + rowSpace;
|
| | | view.Y = intBottom + rowSpace;
|
| | | }
|
| | | base.AddChidren(view);
|
| | | }
|
| | |
| | | this.Height = bottomHeight + bottomSpace;
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取坐标底部最下面的那个控件的底部坐标
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | private int GetLocationMostLastViewBottom()
|
| | | {
|
| | | int bottomHeight = -1;
|
| | |
|
| | | for (int i = 0; i < this.ChildrenCount; i++)
|
| | | {
|
| | | var child = this.GetChildren(i);
|
| | | if (child.Bottom > bottomHeight)
|
| | | {
|
| | | bottomHeight = child.Bottom;
|
| | | }
|
| | | }
|
| | | return bottomHeight;
|
| | | }
|
| | | }
|
| | | }
|