Android Question DesignerLabel.SetBackgroundImage in CustomView XUI Views not work

AlfaizDev

Well-Known Member
Licensed User
B4X:
Dim bmp As Bitmap = (LoadBitmap(File.DirAssets, "button.jpg"))

    CLV1.DesignerLabel.SetBackgroundImage(bmp)

I want to set the background image for each item in the list
 

AlfaizDev

Well-Known Member
Licensed User
DesignerLabel is only used for the text properties of "AddText" items.

How are you creating the items?


B4X:
    cmd = SQL1.ExecQuery("SELECT  * FROM T where Title like '" & Main.CLV1Value &"'" )
    CLV1.Clear
    For i = 0 To cmd.RowCount -1
        cmd.Position = i
        'CLV1.GetBase.SetBitmap(bmp)
     
        Content= cmd.GetString("Content")
        FootNote=  cmd.GetString("FootNote")
        Id=cmd.GetInt("Id")

        CLV1.AddTextItem(Content ,Id)
'    
    Next
 
Last edited:
Upvote 0

AlfaizDev

Well-Known Member
Licensed User

Thanks he works
Apply the code on the Label
B4X:
Dim Panel As B4XView = CLV1.GetPanel(i)
        Dim lbl As Label = Panel.GetView(0)
        lbl.SetBackgroundImage(bmp)
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…