From a1b0ab7044100daaa7e0f1da2d2ca45e38098963 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 29 三月 2021 09:13:25 +0800
Subject: [PATCH] 2021-3-29-2
---
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs | 77 ++++++++++++++++++++++++++++++++++++++
1 files changed, 77 insertions(+), 0 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs
index 633bf36..6a79288 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs
@@ -62,6 +62,83 @@
/// <summary>
/// 鍔ㄦ�佸姞杞芥寜閽垪琛�
/// </summary>
+ /// <param name="vv">鐖舵帶浠�</param>
+ /// <param name="list">鏁版嵁鍒楄〃</param>
+ /// <param name="action">鍥炶皟</param>
+ /// <param name="if_bool">琛ㄧず鏄惁鏄剧ず鍒犻櫎鍥炬爣</param>
+ public void AddButton2(VerticalScrolViewLayout vv, List<Entity.AttributesStatus> list, Action<Entity.AttributesStatus> action, bool if_bool)
+ {
+ //瀹氫箟涓�涓彉閲忚褰曡鏁�
+ int sum = 0;
+ if (list.Count % 3 == 0)
+ {
+ sum = list.Count / 3;
+ }
+ else
+ {
+ sum = list.Count / 3 + 1;
+ }
+ //璁$畻鍔犺浇鍑烘潵鐨勬暟鎹渶瑕佺殑楂樺害
+ int h = 16 + sum * (16 + 44) + 104 + 76;
+ int line = 0;
+ //鎸夐挳鐨勭埗鎺т欢
+ var FLayout = new FrameLayout
+ {
+ Height = Application.GetRealWidth(h),
+ };
+ vv.AddChidren(FLayout);
+ for (int i = 1, j = 0; i <= list.Count; i++, j++)
+ {
+ var nameObj = list[i - 1];
+ //鎸夐挳
+ var buttonNameBtn = new Button
+ {
+
+ Y = Application.GetRealHeight(16 + line * (16 + 44)),
+ X = Application.GetRealWidth(16 + (16 + 104) * j),
+ Width = Application.GetRealWidth(104),
+ Height = Application.GetRealHeight(44),
+ Text = nameObj.value,
+ TextSize = TextSize.text16,
+ TextColor = CSS.CSS_Color.textColor,
+ TextAlignment = TextAlignment.Center,
+ Radius = (uint)Application.GetRealHeight(18),
+ BorderWidth = 1,
+ BorderColor = CSS.CSS_Color.textCancelColor,
+ };
+ FLayout.AddChidren(buttonNameBtn);
+ //鍒犻櫎鍥炬爣
+ var delIconBtn = new Button
+ {
+ UnSelectedImagePath = "PirIcon/delbuton.png",
+ Y = Application.GetRealHeight(12 + line * (16 + 44)),
+ X = Application.GetRealWidth((16 + 92) + (104 + 16) * j),
+ Width = Application.GetRealWidth(16),
+ Height = Application.GetRealWidth(16),
+ Tag = nameObj,
+ };
+ if (if_bool)
+ {
+ FLayout.AddChidren(delIconBtn);
+ }
+ //鍒犻櫎鍥炬爣鐨勭偣鍑讳簨浠�
+ delIconBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ var obj = delIconBtn.Tag as Entity.AttributesStatus;
+ action(obj);
+ };
+ if (i % 3 == 0)
+ {
+ //婊′竴琛岄噸缃甹=0鍊�;
+ j = -1;
+ line += 1;
+ }
+
+ }
+ }
+ /// <summary>
+ /// 鍔ㄦ�佸姞杞芥寜閽垪琛�
+ /// </summary>
/// <param name="FLayout">鐖舵帶浠�</param>
/// <param name="action">鍥炶皟</param>
/// <param name="sum">澶氬皯涓狥rameLayout鎺т欢</param>
--
Gitblit v1.8.0