Hola,
how do i get the view tag using a single sub? there are 60 imageviews.
This code generate a clv filled with images, once i click one image i need to know which one was clicked.
Thanks
how do i get the view tag using a single sub? there are 60 imageviews.
This code generate a clv filled with images, once i click one image i need to know which one was clicked.
B4X:
Sub btn_selectimg_Click
clv.Initialize(Me, "clv")
Activity.AddView(clv.AsView, 0, 80dip , 100%x, 100%y)
Dim p As Panel
p.Initialize("")
p.color = Colors.ARGB(255,235,235,235)
clv.Add(p, 500dip, Null)
p.LoadLayout("clvlayout")
For x = 0 To p.NumberOfViews -1
If p.GetView(x) Is ImageView Then
p.GetView(x).SetBackgroundImage(LoadBitmapSample(File.DirAssets, "img_s/"& x&"_image.png", 100, 100))
'Add tag
p.GetView(x).Tag = x
Log(p.GetView(x).Tag) 'I need this outside frome this sub
End If
Next
End Sub
Sub clv_ItemClick(Position As Int, Value As Object)
'here i need to get the clicked imageview tag
End sub
Thanks