List of images that wrap

I have a LinearLayout with a fixed view. I dynamically insert images (ImageViews) into it, but I don’t know in advance how many of them will be inserted. I would like to have a layout where the wrapping of images and the transition to a new line automatically when they exceed the available width of the father (LinearLayout)

How do you recommend me to move?

Many thanks

+3
source share
2 answers

Define the list in a linear layout as shown below. Wrap the linear layout tags around it.

<ListView
    android:id="@android:id/list" 
    android:layout_width="fill_parent" 
    android:layout_height="0dp"
    android:layout_weight="1"
    android:drawSelectorOnTop="false"
    android:scrollbarAlwaysDrawVerticalTrack="true" 
/>

Dynamically update this list when adding images. This will solve your problems.

0
source

question, :

Android , Swing FlowLayout, . , LinearLayout .. , .

!

0

Source: https://habr.com/ru/post/1742787/


All Articles