Android Question Scrollview report conversion to xCLV

jai

Active Member
Licensed User
Longtime User
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.
 

jai

Active Member
Licensed User
Longtime User
Don't use AddTextItem. Create a layout with the designer and then:
B4X:
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, "")
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
Top