From d6fb0646531172f23648441c224cdcccd721b894 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期一, 14 十二月 2020 09:59:01 +0800
Subject: [PATCH] 请合并代码,完成晾衣架最终功能。
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameListControl.cs | 31 +++++++++++++++++++++++++------
1 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameListControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameListControl.cs
index ed13ec9..636f8a8 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameListControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameListControl.cs
@@ -32,10 +32,10 @@
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)
@@ -46,10 +46,10 @@
else
{
//闈濬rameRowLayout鎺т欢鐨勬椂鍊�,璁$畻鐨勬槸鍧愭爣
- 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);
}
@@ -76,5 +76,24 @@
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;
+ }
}
}
--
Gitblit v1.8.0