陈嘉乐
2021-02-23 780b8b391bc92fba473291ec8151df5860749408
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
using System;
using HDL_ON.UI.UI2.Intelligence.Automation.LogicView;
using Shared;
using System.Collections.Generic;
 
namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice
{
    public class Test:FrameLayout
    {
        
 
        public void Show() {
            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
            PirDevice.View.TopView topView = new View.TopView();
            topView.topNameBtn.TextID = StringId.hongwaiyaokong;
            this.AddChidren(topView.FLayoutView());
            topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); };
            MusicVerticalScrolViewLayout vv = new MusicVerticalScrolViewLayout();
            vv.Y = Application.GetRealHeight(64);
            vv.Height = Application.GetRealHeight(667 - 64);
            this.AddChidren(vv);
            var list = new List<int> { 1, 2, 3, 4, 5, 6, 7 };
             
 
            int line = 0;
            for (int i = 1, j = 0; i < list.Count; i++, j++)
            {
                var currpirdeviceFLayout = new FrameLayout
                {
                    Width = Application.GetRealWidth(98),
                    Height = Application.GetRealWidth(44),
                    X = Application.GetRealWidth(24 + (16 + 98) * j),
                    Y = Application.GetRealHeight(16 + (44+16) * line),
                    Radius= (uint)Application.GetRealHeight(8),
                    BackgroundColor=0xff678536,
                };
                vv.AddChidren(currpirdeviceFLayout);
             
                var deviceNameBtn = new Button
                {
                    TextSize = TextSize.text12,
                    TextColor = CSS.CSS_Color.view,
                    TextAlignment = TextAlignment.Center,
                    Text=list[i].ToString(),
                };
                currpirdeviceFLayout.AddChidren(deviceNameBtn);
                if (i % 3 == 0)
                {
                    //满一行重置j=0值;
                    j = -1;
                    line += 1;
                }
 
            }
 
        }
 
    }
}