Dynamically place views in a new line in the layout for horizontal placement when the container overflows

I have a MapView where Drawable markers are placed with a limit set to 10. A RadioButton is created for each marker to individually select them to move to another place on the map. They use the same RadioGroup for mutual exclusivity. When five RadioButtons are placed horizontally, I want to launch a โ€œnew lineโ€ across the screen of another five RadioButtons .

To do this, you can use the new RadioGroup on the second line, which is somehow connected with the first? Or is there a property for layouts ( ViewGroup ) that forces Views on a new line when it "overflows" the container container horizontally? In my experiments, layouts amplify Views further to the right when the container does not have room for it on the screen. CSS has a good solution for this by setting "overflow:hidden" to contain elements inside its container, and it would be nice with something similar here.

+4
source share
1 answer

What you can try to solve in this answer . This worked pretty well for a similar problem that I had some time ago.

+3
source

All Articles