Reputation: 4532
I have a ConstraintLayout
and I'm adding a maxHeight constraint by using constraintSet.constrainMaxHeight(R.id.recyclerView, (Utils.getScreenHeight() / 2.2).toInt())
Later in my excecution I need to remove this max height constraint, so I do:
constraintSet.connect(R.id.recyclerView, TOP, PARENT, TOP)
constraintSet.constrainHeight(R.id.recyclerView, MATCH_CONSTRAINT)
constraintSet.constrainMaxHeight(R.id.liveFeedRecyclerView, UNSET)
However, my recyclerView still has the "max height" assigned to it. What is the proper way of unsetting the max height constraint and setting my view's height to Match Constraint?
P.S.: All the Constant values are the constants found in the ConstraintSet
class.
Upvotes: 0
Views: 543
Reputation: 62841
It looks like ConstraintLayout defaults the max height to Integer.MAX_VALUE
(decimal value is 2147483647), so try using that instead of UNSET
which is -1.
Upvotes: 1