Android Question Small cards

Dianzoa

Active Member
Licensed User
Hello.
I have tried the cardview example, works great, but the problem is that the activity in which the panel is created is larger than the panel itself. So for many cards, there is a lot of space in between. It is possible to adapt the activity (parent) to the size only of the panel in which it is loaded?

Image: If I have mutiple cards results, the space between them is the gray space at the botton of the panel.

upload_2019-5-23_4-22-8.png
 

Dianzoa

Active Member
Licensed User
Upload a small project which shows the issue.

This is a variant of the card example from Erel. I just put a little labels, and see how that blue background which is the activity where the card is created occupy much more space than his children panel. I need the activity adapts to the panel children, so the cards are 1 below the other.
 

Attachments

  • small_cards.zip
    480.8 KB · Views: 227
Upvote 0

Dianzoa

Active Member
Licensed User
This is what I get, but I want a smaller card, it's too big for a few info.
The layout in the first post is wrong. You are not using anchors correctly. Best to watch the visual designer video tutorial.

Panel1 shouldn't be anchored to the top only (or change the variant size and make it much shorter).

Ok! Thanks, I was drowning in a drop of water lol, just adjust the height of the panel before loading the designer file do the trick

B4X:
Dim height As Int = 150dip
    If GetDeviceLayoutValues.ApproximateScreenSize < 4.5 Then height = 310dip
    p.SetLayoutAnimated(0, 0, 0, Width, height)
    p.LoadLayout("card1")

Just play around with the height and it works.
 
Upvote 0
Top