Hello,
I am using CustomlistView and placed button dynamically.
I mam using below code to create the button at Customlistview. Now I wanted to place a text [For example : Click or Expand or Any text].
How do I place a text on the button at customListview.
Below is my code for creating buttons dynamically
I am using CustomlistView and placed button dynamically.
I mam using below code to create the button at Customlistview. Now I wanted to place a text [For example : Click or Expand or Any text].
How do I place a text on the button at customListview.
Below is my code for creating buttons dynamically
B4X:
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Main")
'CLV1.DefaultTextBackgroundColor=Colors.Gray
For i = 0 To 100
CLV1.Add(createItem("Item #" & i,CLV1.AsView.Width,200dip),i)
Next
End Sub
private Sub createItem(Text As String,width As Int,height As Int) As B4XView
Dim p As B4XView=xui.CreatePanel("")
Dim btnxpan As Button
btnxpan.Initialize("")
p.SetLayoutAnimated(0,0,0,100%x,10%x)
p.Color=Colors.White
btnxpan.Color=Colors.Gray
btnxpan.TextColor=Colors.Black
btnxpan.Width=70%x
p.AddView(btnxpan,90%x,10dip,10dip,10dip)
Return p
End Sub