-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Flexbox showing a lot of items on the last line of maxLine #440
Comments
I am facing the same problem right now |
How did you get 4 items in the first two rows? Was it done with some attribute or FLexBox just randomly added 4 and pushed others into 3rd? Because I am looking for an attribute that defines max column count. |
@mecoFarid it was "randomly", actually based on the smartphone screen width. |
same problem for me, maxLine is useless is this case. How did you guys overcome this issue? |
@redmanit I did it manually... Stopped using maxLine, set height size to a fixed dp number and when the user clicks on expand, I change the height to wrap content. |
@guuilp so you need to calculate that fixed height size programmatically base on item height and padding, right? |
same problem,please fix |
maxline is very important |
Same problem. I just want to show limited items by set maxline. Don't show more item if the item can not visible fully.Don't shrink the margin for the visible item of last line.thanks |
Same problem. I want to scroll when item is out of the maxLine. thanks |
same problem...still not fixed |
same problem |
Please fix that, it's very important feature for me and I think for many people too. |
I work around it by custom function max line, inside the class FlexboxHelper
You can find my change here, but sorry for code format style so you hard to read. |
i do this,but do not work,my maxline is 3, but can see 5 lines |
Hmm, could you try my repository https://github.com/haiithust/flexbox-layout |
Have you tried add I learned this from the library unit test code: https://github.com/google/flexbox-layout/pull/424/files#diff-dfc1316fbcda7918a7dfadcea4a274a8R3982 |
@Anthonyeef this would help a bit, although if last element exceeds the width, it will be shown truncated anyways. It shouldn't be shown in this case. |
Is this issue sorted ? or is there a work around for this ? |
bump for solution |
Anyone listening here? |
Waiting fix it. |
work around way 1:
way 2: |
@act262 can you please post way 1 in java? |
For anyone who is still struggling, here is one trick idea. Let's say you wanna make max line 3 flexbox layout with non truncated content on the last line.
That's it! |
thank you! |
nice work |
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
The text was updated successfully, but these errors were encountered: