-
Notifications
You must be signed in to change notification settings - Fork 176
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
Flow views getting clipped #763
Labels
bug
Something isn't working
Comments
I suspect it might be related to using constrainedWidth/Height at the same time -- what does it look like when you are only setting constrainedWidth=true ? thanks |
Not sure we understand what you are doing in : views.forEachIndexed { index, view ->
referenceIds[index] = view.id
constraintLayout.addView(
view,
ConstraintLayout.LayoutParams(
ConstraintLayout.LayoutParams.WRAP_CONTENT,
ConstraintLayout.LayoutParams.WRAP_CONTENT
).apply {
constrainedWidth = true
constrainedHeight = true
}
)
} Why did you set It implies Flow gets to decide what its height is. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a horizontal chain flow of programatically added items (key-value pairs).
Each item is added with the following layout params:
When I add an item with a lot of text, the view is being clipped at the bottom (screenshot 1).
Everything is working fine if a flow has no horizontal paddings/margins, and horizontally constrained to the parent (Screenshot 2).
Seems like large views are getting measured wrong.
Demo project: constraint-layout-issue
activity_main.xml
item_view.xml
MainActivity.kt
❌ Screenshot 1 – flow constrained to guidelines (start/end=16dp), large views getting clipped.
✅ Screenshot 2 – flow constrained to the parent, everything is fine.
The text was updated successfully, but these errors were encountered: