I have a constraint layout that is constrained to the top of a view. I want the constraint layout to exceed that border (top of the view) (it needs to be constrained to that view). How I can do that?
Asked
Active
Viewed 80 times
0
-
1Not sure if I got it correctly but if so then you're probably looking for negative margins. You can read more about this approach here: https://stackoverflow.com/questions/10673503/is-it-a-bad-practice-to-use-negative-margins-in-android – Pawel Woroniecki Sep 25 '21 at 22:14
-
1@PawelWoroniecki is correct and negative margins may be what you need, although the answer he refers you to is out of date. As of _ConstraintLayout_ [2.1.0-alpha-2](https://androidstudio.googleblog.com/2020/12/constraintlayout-210-alpha-2.html) negative margins are directly supported. See also [here](https://stackoverflow.com/questions/42984909/how-to-achieve-overlap-negative-margin-on-constraint-layout/43016512#43016512). – Cheticamp Sep 27 '21 at 01:34