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 { 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; } } } } }