项目单击自定义列表视图basic4android

时间:2019-03-11 16:29:13

标签: android basic basic4android

我在b4a中创建了一个customlistview,但无法修复click事件。

我希望按钮单击图像时暂停播放,其他按钮图像播放时 当单击图像按钮更改但其他按钮图像未更改时。

enter image description here

我的代码加载

Sub load
For i = 0 To cur.RowCount-1
cur.Position=i
Dim p As Panel
play.Text = Chr(0xE037)
p.Initialize("p")
sco.Panel.AddView(p,1%x,top,98%x,500dip)
p.LoadLayout("layload")
play.Tag = cur.GetInt("id")
play.Typeface = awf
text.Text = cur.GetString("text")
top = top + 60dip + 2%x
Next
sco.Panel.Height = top + 10dip
End Sub

和代码播放

Sub play_Click
tim.Enabled = True
Dim lml As Label
lml.Initialize("lml")
lml = Sender
Dim curbv As Cursor
curbv = sql.ExecQuery("SELECT * FROM tab1 ")
curbv.Position = lml.Tag - 1
sec = curbv.Position
meda.Load(File.DirAssets,curbv.GetString("mp"))
kl(lml)
End Sub

和我的更改代码图标

Sub kl( ln As Label) 
If ln.Text = Chr(0xE037) Then
ln.Text = Chr(0xE047)
meda.Play
load
Else If ln.Text = Chr(0xE047) Then
ln.Text = Chr(0xE037)
meda.Stop
End If
Sleep(100)
play.Text = Chr(0xE037)
End Sub

0 个答案:

没有答案