黄学彪
2019-12-31 737c036a39176fd2085ce82b7c60391da8cb508c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using System;
using System.Collections.Generic;
using System.Text;
 
namespace Shared.Phone.UserCenter
{
    /// <summary>
    /// 场景图片的控件
    /// </summary>
    public class ScenePictrueControl : FrameRowControl
    {
        #region ■ 初始化_____________________________
 
        /// <summary>
        /// 场景图片的控件(拥有桌布)
        /// </summary>
        public ScenePictrueControl()
        {
            this.UseClickStatu = false;
            this.Height = Application.GetRealHeight(470);
        }
 
        /// <summary>
        /// 初始化控件
        /// </summary>
        /// <param name="sceneUI">场景控件</param>
        public void InitControl(Common.SceneUI sceneUI)
        {
            //场景图片
            var btnPic = new ImageView();
            btnPic.X = Application.GetRealWidth(179);
            btnPic.Width = Application.GetRealWidth(844);
            btnPic.Height = Application.GetRealHeight(420);
            if (sceneUI.IconPathType == 0)
            {
                btnPic.ImagePath = sceneUI.IconPath;
            }
            else if (Common.Global.IsExistsByHomeId(sceneUI.IconPath) == true)
            {
                btnPic.ImageBytes = Common.Global.ReadFileByHomeId(sceneUI.IconPath);
            }
            btnPic.Radius = (uint)Application.GetRealHeight(17);
            this.AddChidren(btnPic, ChidrenBindMode.NotBind);
 
            //它的上面有一层阴影
            var frameBack = new FrameLayout();
            frameBack.Width = btnPic.Width;
            frameBack.Height = btnPic.Height;
            frameBack.X = btnPic.X;
            frameBack.BackgroundColor = 0x40000000;
            frameBack.Radius = (uint)Application.GetRealHeight(17);
            this.AddChidren(frameBack, ChidrenBindMode.BindEventOnly);
 
            var btnName = new NormalViewControl(251, 282, true);
            btnName.IsMoreLines = true;
            btnName.X = ControlCommonResourse.XXLeft;
            btnName.Y = Application.GetRealHeight(58);
            btnName.BackgroundColor = 0xd6333333;
            btnName.RadiusEx = 17;
            btnName.Text = sceneUI.Name;
            btnName.TextSize = 15;
            btnName.TextColor = UserCenterColor.Current.White;
            btnName.TextAlignment = TextAlignment.Center;
            this.AddChidren(btnName, ChidrenBindMode.BindEventOnly);
        }
 
        #endregion
    }
}