Hi,
I have an app where I a custom list view made with custom panels (cards) made with few labels and a couple of images.
I need to change at run time the cards on cards click event and I can do that without problems leveraging the Tag properties of the view for the labels.
for some reasons I cannot change the image using the setbitmap method which works just fine when I use it to set the image when I create the cards using:
Any idea why the SetBitmap does not seem to load the image ?
thanks!
I have an app where I a custom list view made with custom panels (cards) made with few labels and a couple of images.
I need to change at run time the cards on cards click event and I can do that without problems leveraging the Tag properties of the view for the labels.
B4X:
Dim pnl As B4XView = CLV1.GetPanel(ClickedAlertCard)
For Each v As View In pnl.GetAllViewsRecursive
If v Is Label Then
Dim lbl As Label = v
Select lbl.Tag
Case "TopicLbl"
lbl.Text = edtAlertTopic.Text
Case "PayloadLbl"
If AlertElement.AlertType = 0 Then
lbl.Text = "=" & edtAlertValue.Text
Else
lbl.Text = AlertElement.AlertOper & edtAlertValue.Text
End If
End Select
End If
If v Is B4XView Then
Dim img As B4XView = v
Select img.Tag
Case "StatusImg"
img.SetBitmap(xui.LoadBitmapResize(File.DirAssets,TempImgStr,img.Width,img.Height,True))
End Select
End If
Next
for some reasons I cannot change the image using the setbitmap method which works just fine when I use it to set the image when I create the cards using:
B4X:
Private Sub CreateItem2(Width As Int, Title As String, Image As String, Content As String) As Panel
Dim p As B4XView = xui.CreatePanel("")
Dim height As Int = 125dip
Dim ss As StringFunctions,TempList As List
ss.Initialize
TempList = ss.Split(Content,",")
If GetDeviceLayoutValues.ApproximateScreenSize < 4.5 Then height = 300dip
p.SetLayoutAnimated(0, 0, 0, Width, height)
p.LoadLayout("Alert")
lblAlertCardTitle.text =Title
lblAlertCardTopic.Text = TempList.Get(0)
If TempList.Get(2) = "0" Then 'boolean
lblAlertCardPayload.Text = " = " & TempList.Get(1)
Else
lblAlertCardPayload.Text = TempList.Get(3) & " " & TempList.Get(1)
End If
imgAlertType.SetBitmap(xui.LoadBitmapResize(File.DirAssets,Image,imgAlertType.Width,imgAlertType.Height,True))
Return p
End Sub
Any idea why the SetBitmap does not seem to load the image ?
thanks!