J jai Active Member Licensed User Longtime User Apr 17, 2025 #1 I am converting a Scrollview code to xCLV used for producing financial reports that have 5 to over 100 text items accross and over 100 rows. Rows have varying number of items and alignments. The cross-platform conversion is needed for horizontal and verticle scrolling ability. The current Scrollview version works fine for scrolling vertical only. On the Scrollview each item is added as a label at a specific position with AddView like- B4X: Dim sv As ScrollView sv.Initialize("sv",SafeWidth,DeviceHeight*3) sv.ContentWidth=SafeWidth sv.ContentHeight=LastLineAt + height0 [B]sv.Panel.AddView(lbl, Left, Top, Width, Height)[/B] What is its equivalent in xCustomListView, especially the positioning of each label? I see 2 options- B4X: [B]clv.Add(Panel, Value) clv.AddTextItem(Text, Value)[/B] But neither allows positioning of the label. How do I add and position each label? Thanks.
I am converting a Scrollview code to xCLV used for producing financial reports that have 5 to over 100 text items accross and over 100 rows. Rows have varying number of items and alignments. The cross-platform conversion is needed for horizontal and verticle scrolling ability. The current Scrollview version works fine for scrolling vertical only. On the Scrollview each item is added as a label at a specific position with AddView like- B4X: Dim sv As ScrollView sv.Initialize("sv",SafeWidth,DeviceHeight*3) sv.ContentWidth=SafeWidth sv.ContentHeight=LastLineAt + height0 [B]sv.Panel.AddView(lbl, Left, Top, Width, Height)[/B] What is its equivalent in xCustomListView, especially the positioning of each label? I see 2 options- B4X: [B]clv.Add(Panel, Value) clv.AddTextItem(Text, Value)[/B] But neither allows positioning of the label. How do I add and position each label? Thanks.
Erel B4X founder Staff member Licensed User Longtime User Apr 20, 2025 #2 Don't use AddTextItem. Create a layout with the designer and then: Code: Dim p As B4XView = XUI.CreatePanel("") p.SetLayoutAnimated(0, 0, 0, 300dip, CLV1.AsView.Width) 'change 300dip with the layout desired height p.LoadLayout("ItemLayout") 'this is the layout CLV1.Add(p, "") Upvote 0
Don't use AddTextItem. Create a layout with the designer and then: Code: Dim p As B4XView = XUI.CreatePanel("") p.SetLayoutAnimated(0, 0, 0, 300dip, CLV1.AsView.Width) 'change 300dip with the layout desired height p.LoadLayout("ItemLayout") 'this is the layout CLV1.Add(p, "")
J jai Active Member Licensed User Longtime User Apr 21, 2025 #3 Erel said: Don't use AddTextItem. Create a layout with the designer and then: Code: Dim p As B4XView = XUI.CreatePanel("") p.SetLayoutAnimated(0, 0, 0, 300dip, CLV1.AsView.Width) 'change 300dip with the layout desired height p.LoadLayout("ItemLayout") 'this is the layout CLV1.Add(p, "") Click to expand... The reports I mentioned above have hundreds of labels of different sizes and alignments. My key question is how do I add a Label in the CLV1 at a specific position with predetermined size and coordinates - Left, Top, Width, Height? Upvote 0
Erel said: Don't use AddTextItem. Create a layout with the designer and then: Code: Dim p As B4XView = XUI.CreatePanel("") p.SetLayoutAnimated(0, 0, 0, 300dip, CLV1.AsView.Width) 'change 300dip with the layout desired height p.LoadLayout("ItemLayout") 'this is the layout CLV1.Add(p, "") Click to expand... The reports I mentioned above have hundreds of labels of different sizes and alignments. My key question is how do I add a Label in the CLV1 at a specific position with predetermined size and coordinates - Left, Top, Width, Height?
Erel B4X founder Staff member Licensed User Longtime User Apr 22, 2025 #4 Exactly like I posted. You can also do it programmatically instead of calling p.LoadLayout. Upvote 0