Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
ConstraintLayout version: 2.2.0; 2.1.4, etc. It seems to be fixed on version 2.0.0-beta2, but then it broke once again.
Here you can see xml:
Steps to reproduce:
Expected behaviour
ScrollView fits all the text as it is constrained to the horizontal center of the screen through the Guideline.
Actual behaviour
ScrollView fits just 2 lines and gets scrolled.
Some comment
It happens because of attribute 'layout_constrainedHeight' and Guidelines (it is essential to add 'layout_constraintTop_toBottomOf' pointing to horizontal Guideline).
Guess that 'layout_constrainedHeight' causes 2 measure cycles to be held for NestedScrollView. On the first one TextView width is calculated without vertical Guidelines so it gets full screen width to put text (2 lines). On the next cycle it respects Guidelines so the number of lines is recalculated (3 lines).
But NestedScrollView gets height of the TextView from the first cycle. Might be some cached value.
Related issues: