From 7a2b08af309d3b16e380c83063da8211cc97217a Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期二, 22 九月 2020 14:18:42 +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