From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameListControl.cs |   99 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 99 insertions(+), 0 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameListControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameListControl.cs
new file mode 100644
index 0000000..c2504a7
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameListControl.cs
@@ -0,0 +1,99 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.UserCenter
+{
+    /// <summary>
+    /// 鍋氭垚涓�涓垪琛ㄥ瀷鐨凢rameLayout(瀹冧笌VerticalListControl鍚屼竴鎬ц川,浣嗘槸瀹冩槸FrameLayout,瀹冧細鏀瑰彉楂樺害)
+    /// </summary>
+    public class FrameListControl : FrameLayoutBase
+    {
+        /// <summary>
+        /// 琛屼箣闂寸殑闂磋窛
+        /// </summary>
+        public int rowSpace = 0;
+
+        /// <summary>
+        /// 鍋氭垚涓�涓垪琛ㄥ瀷鐨凢rameLayout(瀹冧笌VerticalListControl鍚屼竴鎬ц川,浣嗘槸瀹冩槸FrameLayout,瀹冧細鏀瑰彉楂樺害)
+        /// </summary>
+        /// <param name="i_rowSpace">琛屼箣闂寸殑闂磋窛(杩欎釜鍊兼槸涓庤鎺т欢缁戝畾涓�璧蜂娇鐢ㄧ殑)</param>
+        public FrameListControl(int i_rowSpace = 12)
+        {
+            rowSpace = Application.GetRealHeight(i_rowSpace);
+        }
+
+        /// <summary>
+        /// 娣诲姞瀛愭帶浠�
+        /// </summary>
+        /// <param name="view"></param>
+        public override void AddChidren(View view)
+        {
+            if (view is FrameRowControl || view is RowLayoutControl)
+            {
+                //FrameRowLayout鎺т欢鐨勬椂鍊�,鐩存帴鎵╁ぇ瀹冪殑楂樺害
+                var intBottom = this.GetLocationMostLastViewBottom();
+                if (intBottom != -1)
+                {
+                    view.Y = intBottom;
+                }
+                base.AddChidren(view);
+                if (rowSpace > 0)
+                {
+                    view.Height += rowSpace;
+                }
+            }
+            else
+            {
+                //闈濬rameRowLayout鎺т欢鐨勬椂鍊�,璁$畻鐨勬槸鍧愭爣
+                var intBottom = this.GetLocationMostLastViewBottom();
+                if (intBottom != -1)
+                {
+                    view.Y = intBottom + rowSpace;
+                }
+                base.AddChidren(view);
+            }
+        }
+
+        /// <summary>
+        /// 璋冩暣鐪熷疄楂樺害
+        /// </summary>
+        /// <param name="bottomSpace">搴曢儴楂樺害(闈炵湡瀹炲��)</param>
+        public void AdjustRealHeight(int bottomSpace = 0)
+        {
+            int bottomHeight = -1;
+
+            for (int i = 0; i < this.ChildrenCount; i++)
+            {
+                var child = this.GetChildren(i);
+                if (child.Bottom > bottomHeight)
+                {
+                    bottomHeight = child.Bottom;
+                }
+            }
+            if (bottomHeight != -1)
+            {
+                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