From c7df85937f73fb347ee0b19e9c052d2d00a6df6c Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期五, 18 九月 2020 13:58:19 +0800
Subject: [PATCH] 新版本

---
 ZigbeeApp/Shared/Phone/UserCenter/Safety/GarrisonAreaSettionMenuForm.cs |   32 +++++++++++---------------------
 1 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/GarrisonAreaSettionMenuForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/GarrisonAreaSettionMenuForm.cs
index dbc1465..40a444d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/GarrisonAreaSettionMenuForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/GarrisonAreaSettionMenuForm.cs
@@ -149,71 +149,61 @@
             btnIcon.UnSelectedImagePath = "Item/Tips.png";
             bodyFrameLayout.AddChidren(btnIcon);
 
-            int XX = 0;
-            int contrWidth = 0;
-
             string msg = string.Empty;
             //24灏忔椂闃插尯
             if (zoonID == 1)
             {
                 //24灏忔椂闃插尯涓嶅彈甯冮槻銆佹挙闃插奖鍝峽0}闃插尯琚Е鍙戠珛鍗虫姤璀0}涓�鑸缃儫闆俱�佺噧姘斻�佹按娴哥瓑浼犳劅鍣�
                 msg = Language.StringByID(R.MyInternationalizationString.u24HourSectorsTipMsg);
-                btnIcon.X = Application.GetRealWidth(233);
-                XX = Application.GetRealWidth(282);
-                contrWidth = Application.GetRealWidth(580);
             }
             //闈欓煶闃插尯
             else if (zoonID == 2)
             {
                 //闈欓煶闃插尯涓嶅彈甯冮槻銆佹挙闃插奖鍝嶏紝闃插尯琚珄0}瑙﹀彂绔嬪嵆鎶ヨ锛岄�氬父涓嶄骇鐢熷0闊虫垨{0}鍏朵粬鎻愮ず锛屽彧鍙戦�佷俊鎭埌鐗瑰畾鐨勬帴鏀惰��
                 msg = Language.StringByID(R.MyInternationalizationString.uMuteSectorsTipMsg);
-                btnIcon.X = Application.GetRealWidth(202);
-                XX = Application.GetRealWidth(279);
-                contrWidth = Application.GetRealWidth(614);
             }
             //鍐呴儴闃插尯
             else if (zoonID == 4)
             {
                 //鍦ㄧ瀹跺竷闃叉ā寮忎笅锛屽唴閮ㄩ槻鍖轰紶鎰熷櫒瑙﹀彂{0}绔嬪嵆鎶ヨ銆傚湪鍦ㄥ甯冮槻妯″紡涓媨0}鍐呴儴闃插尯鎵�鏈変紶鎰熷櫒涓嶅弬涓庢姤璀�
                 msg = Language.StringByID(R.MyInternationalizationString.uInteriorSectorsTipMsg);
-                btnIcon.X = Application.GetRealWidth(179);
-                XX = Application.GetRealWidth(256);
-                contrWidth = Application.GetRealWidth(651);
             }
             //鍛ㄧ晫闃插尯
             else if (zoonID == 5)
             {
                 //绂诲甯冮槻妯″紡鎴栧湪瀹跺竷闃叉ā寮忎笅{0}鍛ㄧ晫闃插尯浼犳劅鍣ㄨЕ鍙戠珛鍗虫姤璀�
                 msg = Language.StringByID(R.MyInternationalizationString.uPerimeterSectorsTipMsg);
-                btnIcon.X = Application.GetRealWidth(239);
-                XX = Application.GetRealWidth(317);
-                contrWidth = Application.GetRealWidth(510);
             }
             //鍑哄叆闃插尯
             else
             {
                 //鍦ㄥ竷闃插悗绯荤粺鎻愪緵涓�瀹氱殑寤惰繜鏃堕棿銆傚嚭闂ㄦ椂{0}澶栧嚭寤舵椂缁撴潫鍚庯紝绯荤粺瑙﹀彂鐩爣鎶ヨ{0}鍥炲鏃讹紝杩涘叆寤舵椂缁撴潫鍚庯紝绯荤粺瑙﹀彂鐩爣鎶ヨ
                 msg = Language.StringByID(R.MyInternationalizationString.uInAndOutSectorsTipMsg);
-                btnIcon.X = Application.GetRealWidth(156);
-                XX = Application.GetRealWidth(216);
-                contrWidth = Application.GetRealWidth(721);
             }
             var ArryMsg = msg.Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
 
             int yy = Application.GetRealHeight(1428);
+            int firstXX = 0;
             for (int i = 0; i < ArryMsg.Length; i++)
             {
-                var btnTip = new NormalViewControl(contrWidth, Application.GetRealHeight(50), false);
+                var btnTip = new NormalViewControl(100, 50, true);
+                btnTip.Y = yy;
                 btnTip.TextAlignment = TextAlignment.Center;
                 btnTip.TextColor = UserCenterColor.Current.TextGrayColor1;
                 btnTip.TextSize = 12;
-                btnTip.X = XX;
-                btnTip.Y = yy;
                 btnTip.Text = ArryMsg[i];
+                btnTip.Width = btnTip.GetRealWidthByText();
+                btnTip.Gravity = Gravity.CenterHorizontal;
                 bodyFrameLayout.AddChidren(btnTip);
 
                 yy = btnTip.Bottom;
+                if (i == 0)
+                {
+                    //璁板綍绗竴鏉sg鐨刋杞�
+                    firstXX = btnTip.X;
+                }
             }
+            btnIcon.X = firstXX - Application.GetRealWidth(23) - btnIcon.Width;
         }
 
         #endregion

--
Gitblit v1.8.0