| | |
| | | /// 行之间的间距
|
| | | /// </summary>
|
| | | public int rowSpace = 0;
|
| | | /// <summary>
|
| | | /// 最大高度
|
| | | /// </summary>
|
| | | private int maxHeight = -1;
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | view.Height += rowSpace;
|
| | | }
|
| | | }
|
| | | if (maxHeight == -1)
|
| | | {
|
| | | maxHeight = this.Height;
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region ■ 调整真实高度_______________________
|
| | |
|
| | | /// <summary>
|
| | | /// 还原高度
|
| | | /// </summary>
|
| | | public void RecoverHeight()
|
| | | {
|
| | | if (this.maxHeight != -1)
|
| | | {
|
| | | this.Height = this.maxHeight;
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 调整控件真实高度(只针对行控件都是相同高度的,高度只会减少,不会增加)
|
| | | /// </summary>
|
| | | /// <param name="bottomSpace">底部空白间距(真实值)</param>
|
| | | public void AdjustRealHeight(int bottomSpace)
|
| | | /// <param name="addSpace">当真实高度超过原有高度时,是否添加空白</param>
|
| | | public void AdjustRealHeight(int bottomSpace, bool addSpace = true)
|
| | | {
|
| | | if (this.ChildrenCount == 0)
|
| | | {
|
| | | //还原为最大高度
|
| | | this.Height = maxHeight;
|
| | | return;
|
| | | }
|
| | | //调整列表控件的高度
|
| | |
| | | //缩小控件高度
|
| | | this.Height = realHeight;
|
| | | }
|
| | | else if (addSpace == true && bottomSpace > 0 && realHeight > this.maxHeight)
|
| | | {
|
| | | var frameBack = new FrameLayout();
|
| | | frameBack.Height = bottomSpace;
|
| | | this.AddChidren(frameBack);
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|