From f1c3921b08bb22ac6f5db22d620e01d7e8e5c49f Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期一, 30 十二月 2019 13:32:33 +0800
Subject: [PATCH] 2019-12-30-1

---
 ZigbeeApp/Shared/Phone/Device/CommonForm/TopFrameLayout.cs |   58 +++++++++++++++++++++++++++++++++-------------------------
 1 files changed, 33 insertions(+), 25 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/TopFrameLayout.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/TopFrameLayout.cs
old mode 100644
new mode 100755
index 049f2e9..4227c91
--- a/ZigbeeApp/Shared/Phone/Device/CommonForm/TopFrameLayout.cs
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/TopFrameLayout.cs
@@ -30,29 +30,25 @@
         /// <summary>
         /// 鏋勯�犳柟娉�
         /// </summary>
-        public TopFrameLayout(FrameLayout parentFrameLayout)
+        public TopFrameLayout()
         {
             BackgroundColor = ZigbeeColor.Current.GXCTopViewBackgroundColor;
-            Width = Application.GetRealWidth(1080);
-            Height = Application.GetRealHeight(CommonFormRrsouce.TopFrameLayout_Height);
-            //鍏堝姞杞藉埌鐖跺鍣紝鍚﹀垯瀛愭帶浠跺竷灞�鏈夐棶棰�
-            parentFrameLayout.AddChidren(this);
-            //鍒濆鍖�
-            InitTopview(parentFrameLayout);
+            Width = Application.GetRealWidth(CommonFormResouce.AppRealWidth);
+            Height = Application.GetRealHeight(CommonFormResouce.TopFrameLayout_Height);
         }
 
         #endregion
 
         #region 鈼� 鍒濆鍖朹_________________________
 
-        private void InitTopview(FrameLayout parentFrameLayout)
+        public void InitTopview()
         {
             //鐘舵�佹爮
             AddTopStatuFrame();
             //topview
             AddTopview();
             //娣诲姞杩斿洖閿�
-            AddBackBtn(parentFrameLayout);
+            AddBackBtn();
             //鏍囬
             AddTitle();
         }
@@ -67,11 +63,19 @@
         {
             topView = new FrameLayout
             {
-                Y = Application.GetRealHeight(CommonFormRrsouce.TopStatuFrameLayout_Height),
-                Height = Application.GetRealHeight(CommonFormRrsouce.Topview_Height),
-                Width = Application.GetRealWidth(1080)
+                Y = Application.GetRealHeight(CommonFormResouce.TopStatuFrameLayout_Height),
+                Height = Application.GetRealHeight(CommonFormResouce.Topview_Height),
+                Width = Application.GetRealWidth(CommonPage.AppRealWidth)
             };
             AddChidren(topView);
+
+            var line = new Button
+            {
+                Y=Height-1,
+                Height=1,
+                BackgroundColor=ZigbeeColor.Current.GXCGrayLineColor3
+            };
+            AddChidren(line);
         }
 
         #endregion
@@ -81,15 +85,10 @@
         /// 杩斿洖閿�
         /// </summary>
         /// <returns>The back button.</returns>
-        private void AddBackBtn(FrameLayout parentFrameLayout)
+        private void AddBackBtn()
         {
             backButton = new BackButton { };
             topView.AddChidren(backButton);
-
-            backButton.MouseUpEventHandler += (sender, e) =>
-            {
-                parentFrameLayout.RemoveFromParent();
-            };
         }
 
         #endregion
@@ -103,8 +102,8 @@
         {
             topStatuFrameLayout = new FrameLayout
             {
-                Height = Application.GetRealHeight(CommonFormRrsouce.TopStatuFrameLayout_Height),
-                Width = Application.GetRealWidth(1080)
+                Height = Application.GetRealHeight(CommonFormResouce.TopStatuFrameLayout_Height),
+                Width = Application.GetRealWidth(CommonPage.AppRealWidth)
             };
             AddChidren(topStatuFrameLayout);
         }
@@ -119,11 +118,12 @@
         {
             topTitle = new Button
             {
-                Height = Application.GetRealHeight(CommonFormRrsouce.TopFrameLayout_Height - CommonFormRrsouce.TopStatuFrameLayout_Height),
-                Width = Application.GetRealWidth(CommonFormRrsouce.TopTitle_Width),
-                TextSize = CommonFormRrsouce.TopTitle_TextSize,
-                TextColor = ZigbeeColor.Current.GXCTextBlackColor,
-                Gravity = Gravity.CenterHorizontal,
+                X=Application.GetRealWidth(164),
+                Height = Application.GetRealHeight(CommonFormResouce.TopFrameLayout_Height - CommonFormResouce.TopStatuFrameLayout_Height),
+                Width = Application.GetRealWidth(CommonFormResouce.TopTitle_Width),
+                TextSize = CommonFormResouce.TopTitle_TextSize,
+                TextColor = ZigbeeColor.Current.GXCTitleBlackTitle,
+                TextAlignment=TextAlignment.CenterLeft
             };
             topView.AddChidren(topTitle);
         }
@@ -135,6 +135,14 @@
         {
             topTitle.Text = title;
         }
+        /// <summary>
+        /// 璁剧疆鏍囬
+        /// </summary>
+        /// <param name="title"></param>
+        public void SetTopTitle(int title)
+        {
+            SetTopTitle(Language.StringByID(title));
+        }
 
         #endregion
     }

--
Gitblit v1.8.0