| | |
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 针对底部点击按钮,调整控件真实高度
|
| | | /// </summary>
|
| | | /// <param name="bottomSpace">底部空白间距(真实值,如果列表控件真实高度没有超过时,使用此值)</param>
|
| | | public void AdjustRealHeightByBottomButton(int bottomSpace)
|
| | | {
|
| | | if (this.ChildrenCount == 0)
|
| | | {
|
| | | frameBackTemp?.RemoveFromParent();
|
| | | frameBackTemp = null;
|
| | | if (maxHeight != -1)
|
| | | {
|
| | | //还原为最大高度
|
| | | this.Height = maxHeight;
|
| | | }
|
| | | return;
|
| | | }
|
| | | var realHeight = this.ChildrenCount * this.GetChildren(0).Height + this.Y;
|
| | | var btnTemp = new BottomClickButton();
|
| | | if (btnTemp.Yaxis >= realHeight)
|
| | | {
|
| | | //没有超过
|
| | | this.AdjustRealHeight(bottomSpace);
|
| | | return;
|
| | | }
|
| | | //超过时,重置至最大
|
| | | this.RecoverHeight();
|
| | |
|
| | | //添加临时控件,直至可以滑动超过底部按钮
|
| | | frameBackTemp?.RemoveFromParent();
|
| | | frameBackTemp = new FrameLayout();
|
| | | frameBackTemp.Height = ControlCommonResourse.BodyFrameHeight - btnTemp.Y;
|
| | | this.AddChidren(frameBackTemp);
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|