Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
For i = 0 To 10
clv2.Add(CreateListItem( i, clv2.AsView.Width, 70dip, True), 70dip, $"Item #${i}"$)
Next
End Sub
Sub CreateListItem(Text As String, Width As Int, Height As Int, isBold As Boolean) As Panel
Dim p As Panel
p.Initialize("")
Activity.AddView(p, 0, 0, Width, Height)
p.LoadLayout("CellItem")
p.RemoveView
Button1.Text = "Button1 Row" & Text
Button2.Text = "Button2 Row" & Text
Return p
End Sub
tryclv2.Add(CreateListItem( i,clv2.AsView.Width, 70dip, True), 70dip, $"Item #${i}"$)
clv2.Add(CreateListItem( i,clv2.AsView.Width, 70dip, True), 70dip, $"Item #${i}"$))
I upload project sample made with scrollview and I want to make with customlistviewI am sorry .. I do not understand .. Saya tidak mengerti
Can anyone else shed light on harry's intentions ?
thanks mangojack dan Donmanfred for the code and example ..I really really thanks
but I want is I put button1 in designer and every record ,,,button1 otomaticly insert to customlistview row to right 2 button and next another row but still button1 , if record nothing button1 is none ,if record one buton1 is only one ,if record 2 button1 is two ,if records 3 button1 2 button1 in first row and 1 in the next row
regard
harry
What I could understand (I get lots of email requesting some features, in this type of language )
1. No record in database = show 1 button
2. One record in database = show 1 button
3. Two records in database = show 2 buttons in a row
4. Three records in database = show 2 buttons in a row and next button in next row.
and so on..
Regards,
Anand
excelent mangojack ..I will try
regard
harry
A better / simpler approach .. I was trying to reposition the single layout within the clv row/panel and finally gave up.if you still need to use CLV which i think would be easier than ScrollView then you could adapt this sample code. ( is in B4J )
This was bugging me and couldn't let it go.
Based on @XbNnX_507 B4J idea /example ... just including possible way of updating items with db data as you go. Mainly for @harry2017 's benefit .
On to other things
I found it easier to get your needed result with a Scrollview .
I have attached a simple example which will demonstrate the basics of what what you need to do. There is certainly refinements to be be made.
I have also made several comments regarding Declaring / Initialising your SQL object and db files etc in the Starter service.
Start a new thread if you have any further questions.
here is the new thread mangojack https://www.b4x.com/android/forum/t...ways-go-to-next-panel-refresh-activity.86731/Please start a new thread explaining your problem .. maybe with a sample project.
In hindsight it would be simpler to use the CustomListView option