question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flexbox showing a lot of items on the last line of maxLine

See original GitHub issue

Issues and steps to reproduce

I’ve been trying the new “maxLines” attribute, but its behavior is not like what I was expecting. Let’s think about a list with 50 items, 4 per line: if I set the maxLIne to 3, the first and second line will show 4 items per line, but the third line will show 42 items, instead of 4. Is there a way to show 4 items in all lines and ignore the others 42?

Expected behavior

Ignore items after third line.

Version of the flexbox library

1.0.0

Link to code

        <com.google.android.flexbox.FlexboxLayout
            android:id="@+id/items_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:maxLine="3"
            android:paddingTop="20dp"
            android:paddingLeft="20dp"
            android:paddingRight="20dp"/>

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:18
  • Comments:25

github_iconTop GitHub Comments

9reactions
titooancommented, Jul 13, 2018

I am facing the same problem right now

5reactions
BenderRodiriguescommented, Sep 21, 2019

Please fix that, it’s very important feature for me and I think for many people too. For now I restrict height of FlexboxLayout but it’s dirty hack

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android FlexboxLayoutManager last row alignment
This will fit as many items in one line, leaving empty spaces of equal width between (thus centering items). The "stranglers" on the...
Read more >
Some ways to align the last row in a flexbox grid - Travis Horn
One of my favorite approaches is to replace flexbox with grid. Delete the empty items so we're left with the original set. display:...
Read more >
max-lines - CSS-Tricks
The max-lines property limits the content of a block to a maximum number of lines before being cut off and can create a...
Read more >
Text Overflow - Tailwind CSS
Flexbox & Grid ... Grid Column Start / End · Grid Template Rows · Grid Row Start / End ... Justify Items ·...
Read more >
-webkit-line-clamp - CSS: Cascading Style Sheets | MDN
In most cases you will also want to set overflow to hidden , otherwise the contents won't be clipped but an ellipsis will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found