Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Child views overlap when FlexboxLayout height is wrap_content #341

Closed
1 task done
ericksli opened this issue Aug 2, 2017 · 4 comments
Closed
1 task done

Child views overlap when FlexboxLayout height is wrap_content #341

ericksli opened this issue Aug 2, 2017 · 4 comments
Milestone

Comments

@ericksli
Copy link

ericksli commented Aug 2, 2017

Issues and steps to reproduce

I add an empty FlexboxLayout in my XML layout file and add some TextViews as child views of the FlexboxLayout dynamically. The FlexboxLayout is configured with height=wrap_content, divider, alignItems, flexWrap, justifyContent in XML layout file.

Using the sample project below to build on Android 7,1.1 (API 25), the TextViews are overlapped but on Android 6.0.1 (API 23) and Android 4.1.6 (API 16) they renders as expected.

device-2017-08-02-231755

If I remove dividerDrawable and showDivider in XML layout file, the tags even not shown as the height of the FlexboxLayout become zero (as seen from Layout Inspector). The height for the overlapped case may come from the sum of all divider height but not include the height of the TextViews.

However, in my real project, the TextViews are overlapped on Android 6.0.1.

Expected behavior

TextViews should not be overlapped, as the screenshot below:

device-2017-08-02-231835

Version of the flexbox library

0.3.0

Link to code

https://github.com/ericksli/flexbox-layout-test

@thagikura
Copy link
Contributor

Thanks for filing this issue and the test project.
Taking a look.

@ericksli
Copy link
Author

ericksli commented Aug 4, 2017

I found that if I set app:alignItems="center" the problem is gone.

@thagikura
Copy link
Contributor

Looks like there is an issue when alignItems is set to baseline with API level +24.
Investigating it further.

@thagikura
Copy link
Contributor

Should be fixed by #342

@thagikura thagikura added this to the 0.3.1 milestone Aug 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants