| | |
| | | namespace Shared.Phone.UserCenter
|
| | | {
|
| | | /// <summary>
|
| | | /// 做成一个里面只装FrameLayout的列表型控件(它不会调整高度)
|
| | | /// 做成一个里面只装FrameLayout的列表型控件(它不会调整高度,有桌布)
|
| | | /// </summary>
|
| | | public class VerticalFrameControl : VerticalScrolViewLayout
|
| | | {
|
| | |
| | | /// <param name="buttomSpace">底部空白间距(真实值)</param>
|
| | | public void AdjustChidrenFrameHeight(FrameLayout frame, int buttomSpace)
|
| | | {
|
| | | var child = frame.GetChildren(frame.ChildrenCount - 1);
|
| | | if (child != null)
|
| | | //获取坐标底部最下面的那个控件的底部坐标
|
| | | int value = this.GetLocationMostLastViewBottom();
|
| | | if (value != -1)
|
| | | {
|
| | | //调整桌布高度
|
| | | if (frame.Height < child.Bottom + buttomSpace)
|
| | | if (frame.Height < value + buttomSpace)
|
| | | {
|
| | | frame.Height = child.Bottom + buttomSpace;
|
| | | frame.Height = value + buttomSpace;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | /// </summary>
|
| | | public void AdjustTableHeight()
|
| | | {
|
| | | var child = this.m_frameTable?.GetChildren(this.m_frameTable.ChildrenCount - 1);
|
| | | if (child != null)
|
| | | //获取坐标底部最下面的那个控件的底部坐标
|
| | | int value = this.GetLocationMostLastViewBottom();
|
| | | if (value != -1)
|
| | | {
|
| | | //调整桌布高度
|
| | | this.m_frameTable.Height = child.Bottom;
|
| | | this.m_frameTable.Height = value;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取坐标底部最下面的那个控件的底部坐标
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | private int GetLocationMostLastViewBottom()
|
| | | {
|
| | | int bottomHeight = -1;
|
| | |
|
| | | if (this.m_frameTable == null) { return bottomHeight; }
|
| | | |
| | | for (int i = 0; i < this.m_frameTable.ChildrenCount; i++)
|
| | | {
|
| | | var child = this.m_frameTable.GetChildren(i);
|
| | | if (child.Bottom > bottomHeight)
|
| | | {
|
| | | bottomHeight = child.Bottom;
|
| | | }
|
| | | }
|
| | | return bottomHeight;
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|