Hello, is this a bug?
Example. Release mode.
However, in Debug mode, that works well.
If I add this line:
The code works fine in Debug and Release mode.
B4A 5
Example. Release mode.
B4X:
Sub Example
' create a panel
Dim p As Panel
p.Initialize("pnItemCompo")
p.Tag = Qt.GetInt("id")
p.Color = Colors.Transparent
' add to HorizontalScrollView
hsvComponentes.Panel.AddView( p, iCol*iAncho, iFil*iAlto, iAncho, iAlto )
'
' add viewimagen
Dim ivImgArti As ImageView
ivImgArti.Initialize("")
p.AddView(ivImgArti,20,0,p.Width-40dip,p.Height-20dip)
ivImgArti.Bitmap = img
ivImgArti.Gravity = Gravity.FILL
' ivImgArti.Tag=0 ' We must put a tag, because it is null. However Debug mode does have a value !!! <---
'
' add imagen OK
Dim ivOk As ImageView
ivOk.Initialize("")
p.AddView(ivOk,0,0,36,36)
ivOk.Bitmap = LoadBitmap(File.DirAssets,"dialog-apply-48.png")
ivok.Gravity = Gravity.FILL
ivOk.BringToFront
ivOk.Tag=(-1) ' Mark
ivOk.Visible=False
End Sub
Sub pnItemCompo_Click
Dim pp As Panel = Sender
For Each vv As View In pp.GetAllViewsRecursive
If vv Is ImageView Then
If vv.Tag=(-1) Then ' <--- Error. Tag is null in Release mode. !!!!!!!!!!!!!
vv.Visible = Not(vv.Visible)
End If
End If
Next
End Sub
If I add this line:
B4X:
ivImgArti.Tag=0 ' We must put a tag, because it is null. However Debug mode does have a value !!! <---
B4A 5