iOS Question XCLV, card height problem (iPhone to iPad screens)

james_sgp

Active Member
Licensed User
Longtime User
Hi,
I`m displaying a list of images in a XCLV, it all looks nice on an iPhone screen (see attached) ... But when viewing on an iPad the cards are cut off (see attached), i understand this is because I`m setting the card height as dip. but as I can't use % in B4i (because of the resize, from what I understand) what is the solution to show the XCLV cards properly?

I've searched the forum but there doesn't seem to be a workable solution.

The 'cards' are designed in the Designer, and anchored left/right and top (see attached), this is the code I`m using to display the cards:

B4X:
Private Sub CreateDeals(url As String, img As String) As Panel
    Dim p As B4XView = xui.CreatePanel("")
    #if b4a
    p.setlayoutanimated(0,0%x,0%y,100%x,21%y)   
    #else if b4i
    p.setlayoutanimated(0,0%x,0%y,100%x,180dip)
    #end if
    p.LoadLayout("card_deals")
    deal_url.Text = url
    #if b4a
    MediaManager.SetMedia(deals_iv, Starter.strURL & "deals/" & img)
    #else if b4i   
    MediaManager.SetMedia(deals_iv, Starter.strURL & "deals/" & su.EncodeUrl(img, "utf8"))
    #end if
    Return p
End Sub

Some guidance would be much appreciated.

Thanks, James
 

Attachments

  • iPad Mini.jpg
    iPad Mini.jpg
    70.6 KB · Views: 77
  • iPhone SE.jpg
    iPhone SE.jpg
    113.4 KB · Views: 78
  • Deisgner Layout - card.jpg
    Deisgner Layout - card.jpg
    137.8 KB · Views: 81
Top