I am trying to implement the code from Erel's customlistview tutorial but I am having a strange problem. I replaced Erel's checkbox with an edittext. When the edittext is clicked and it gains focus, I do not get a cursor. The text will appear as soon as I type, but without the cursor it is impossible to know which edittext has focus. The following code is Erel's example without changes.
And now my code with the edittext replacing the checkbox.
Does anyone know what is going on?
Dan
B4X:
Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel
Dim p As Panel
p.Initialize("")
p.Color = Colors.Black
Dim b As Button
b.Initialize("button") 'all buttons click events will be handled with Sub Button_Click
Dim chk As CheckBox
chk.Initialize("chk")
Dim lbl As Label
lbl.Initialize("")
lbl.Gravity = Bit.OR(Gravity.CENTER_VERTICAL, Gravity.LEFT)
lbl.Text = Text
lbl.TextSize = 16
lbl.TextColor = Colors.White
b.Text = "Click"
p.AddView(lbl, 5dip, 2dip, 150dip, Height - 4dip) 'view #0
p.AddView(b, 155dip, 2dip, 110dip, Height - 4dip) 'view #1
p.AddView(chk, 280dip, 2dip, 50dip, Height - 4dip) 'view #2
Return p
End Sub
B4X:
Sub createlibitem(text As String, width As Int, height As Int) As Panel
counter=counter + 1
Dim p As Panel
p.Initialize("")
p.Color = Colors.Black
' Dim bpart As Button
Dim bpart As Label
bpart.Initialize("button") 'all buttons click events will be handled with Sub Button_Click
bpart.Typeface = comic
bpart.TextSize = 50
bpart.TextColor=-1
bpart.Color = Colors.ARGB(125,100,149,237)
Dim partbox As EditText
partbox.Initialize("boxes")
partbox.Typeface = comic
partbox.TextSize = 28
partbox.Color = -1
partbox.TextColor = -16777216
partbox.SingleLine=True
partbox.ForceDoneButton=True
bpart.Gravity= Bit.OR(Gravity.CENTER_VERTICAL, Gravity.center_horizontal)
bpart.text = text
bpart.TextSize = 28
bpart.TextColor=Colors.white
p.AddView(bpart, 5dip, 0dip, 150dip, height)'-4dip) 'view #1
p.AddView(partbox, 200dip, 2dip, 150dip, height-4dip) 'view #2
Return p
End Sub
Dan