From 9904031f5291daaf56985146bb671f25e18ebbdf Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 02 四月 2020 19:51:31 +0800 Subject: [PATCH] 最新代码 --- ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs | 39 +++++++++++++++++++++++++++++++-------- 1 files changed, 31 insertions(+), 8 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs index d0773fd..ae4657c 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs @@ -24,6 +24,10 @@ /// 鎴块棿鍚嶇О鎺т欢 /// </summary> private NormalViewControl btnRoomName = null; + /// <summary> + /// 鎴块棿鍚嶅瓧鐨勮儗鏅� + /// </summary> + private NormalViewControl btnRoomNameBackGroud = null; #endregion @@ -66,14 +70,29 @@ frameBack.BackgroundColor = 0x33000000; this.AddChidren(picRoom, ChidrenBindMode.BindEventOnly); + ////鎴块棿鍚嶅瓧鐨勮儗鏅� + //var btnRoomNameBackGroud = new NormalViewControl(Application.GetRealWidth(141), Application.GetRealHeight(84), false); + //btnRoomNameBackGroud.X = Application.GetRealWidth(14); + //btnRoomNameBackGroud.UnSelectedImagePath = "Room/RoomCardView_Name.png"; + //this.AddChidren(btnRoomNameBackGroud, ChidrenBindMode.BindEventOnly); + + ////鎴块棿鍚嶅瓧 + //this.btnRoomName = new NormalViewControl(btnRoomNameBackGroud.Width, btnRoomNameBackGroud.Height, false); + //btnRoomName.X = Application.GetRealWidth(14); + //btnRoomName.TextSize = 12; + //btnRoomName.IsBold = true; + //btnRoomName.TextAlignment = TextAlignment.Center; + //btnRoomName.TextColor = UserCenterColor.Current.White; + //this.AddChidren(btnRoomName, ChidrenBindMode.BindEventOnly); + //鎴块棿鍚嶅瓧鐨勮儗鏅� - var btnRoomNameBackGroud = new NormalViewControl(Application.GetRealWidth(141), Application.GetRealHeight(84), false); + this.btnRoomNameBackGroud = new NormalViewControl(Application.GetRealWidth(141), Application.GetRealHeight(84), false); btnRoomNameBackGroud.X = Application.GetRealWidth(14); - btnRoomNameBackGroud.UnSelectedImagePath = "Room/RoomCardView_Name.png"; + btnRoomNameBackGroud.BackgroundColor = 0x80000000; this.AddChidren(btnRoomNameBackGroud, ChidrenBindMode.BindEventOnly); //鎴块棿鍚嶅瓧 - this.btnRoomName = new NormalViewControl(btnRoomNameBackGroud.Width, btnRoomNameBackGroud.Height, false); + this.btnRoomName = new NormalViewControl(50, Application.GetRealHeight(84), false); btnRoomName.X = Application.GetRealWidth(14); btnRoomName.TextSize = 12; btnRoomName.IsBold = true; @@ -99,15 +118,19 @@ { //鍒锋柊鍚嶅瓧 btnRoomName.Text = room.Name; - if (btnRoomName.GetRealWidthByText() > Application.GetRealWidth(141)) + int realWidth = btnRoomName.GetRealWidthByText() + Application.GetRealWidth(70); + if (realWidth < Application.GetRealWidth(141)) { - //瀛椾綋闀垮害瓒呰繃 - btnRoomName.TextAlignment = TextAlignment.CenterLeft; + realWidth = Application.GetRealWidth(141); } - else + else if (realWidth > Application.GetRealWidth(420)) { - btnRoomName.TextAlignment = TextAlignment.Center; + realWidth = Application.GetRealWidth(420); } + btnRoomName.Width = realWidth; + btnRoomNameBackGroud.Width = realWidth; + btnRoomNameBackGroud.SetCornerWithSameRadius(picRoom.Radius, HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomRight); + //鍒锋柊鍥剧墖 if (room.BackgroundImageType == 0) { -- Gitblit v1.8.0