If i create dinamically scrollview, how do i return a click event from current pressed img or button?
i want to do a sub that return the currently clicked, for ex the imgview pressed event for the pressed img.
or set another properties to imgview pressed by the event.
i was thinking doing a shared sub like
Thanks.
B4X:
For i1 = 0 To 5
Dim img As ImageView
img.Initialize("img")
img.Gravity=Gravity.FILL
img.Bitmap=LoadBitmap(File.DirAssets , "image.webp")
Dim pnl As HorizontalScrollView
pnl.Initialize(500dip,"scroll"&i)
pnl.Panel.Initialize("")
appscrollpnl.Panel.AddView(pnl,10dip,topanel, Activity.Width - 20dip, 80dip)
pnl.Panel.Width=480dip
pnl.Width=Activity.Width-20dip
pnl.Panel.AddView(img,left,0,80dip,80dip)
left=left + 80dip
Next
i want to do a sub that return the currently clicked, for ex the imgview pressed event for the pressed img.
or set another properties to imgview pressed by the event.
i was thinking doing a shared sub like
B4X:
Sub img_Click()
Self.width(300dip) or this.width(300dip) or sender.width(300dip)
End
Thanks.
Last edited: