iOS Question Cannot Change Dimensions of ImageView in CustomListView

mmieher

Active Member
Licensed User
Longtime User
Not sure what I am doing wrong here, but all the images are displaying as 135x37. Two of them should be 60x60.

B4X:
Sub CreateListItem(idCustName As String, idLogoFile As String) As Panel
   
    Dim p As Panel
    p.Initialize("")
    p.LoadLayout("CustomerPanel")
    p.SetLayoutAnimated(0,1,0,0,435dip,65dip)
    lCustName.Text = idCustName
    Select idLogoFile.ToLowerCase
       
        Case "gardenbar75.png", "littlebigburger.jpg"
            ivLogo.SetLayoutAnimated(0,1,10,15,135,37)
            ivLogo.Bitmap = LoadBitmapResize(File.DirDocuments,"ShopperMenu/Images/" & idLogoFile, 135dip, 37dip,False)
           
        Case "uptownliquor.jpg","lovejoyliquor.jpg"
            ivLogo.SetLayoutAnimated(0,1,10,15,60,60)
            ivLogo.Bitmap = LoadBitmapResize(File.DirDocuments,"ShopperMenu/Images/" & idLogoFile, 60dip, 60dip,False)
           
    End Select
   
    Return p
   
End Sub
 

mmieher

Active Member
Licensed User
Longtime User
Thank you, Erel. I changed the code, added the xCustomListView library. Removed the CustomListView.bas module. No difference. All four images still 123x37.

B4X:
Sub CreateListItem(idCustName As String, idLogoFile As String) As Panel
   
    Dim p As Panel
    p.Initialize("")
    p.SetLayoutAnimated(0,1,0,0,435dip,65dip)
    p.LoadLayout("CustomerPanel")
   
    lCustName.Text = idCustName
    Select idLogoFile.ToLowerCase
       
        Case "gardenbar75.png", "littlebigburger.jpg"
            ivLogo.SetLayoutAnimated(0,1,10,15,135,37)
            ivLogo.Bitmap = LoadBitmapResize(File.DirDocuments,"ShopperMenu/Images/" & idLogoFile, 135dip, 37dip,False)
           
        Case "uptownliquor.jpg","lovejoyliquor.jpg"
            ivLogo.SetLayoutAnimated(0,1,10,15,60,60)
            ivLogo.Bitmap = LoadBitmapResize(File.DirDocuments,"ShopperMenu/Images/" & idLogoFile, 60dip, 60dip,False)
           
    End Select
   
    Return p
   
End Sub
 
Upvote 0
Top