0
child.layout(x, y, x + child.getMeasuredWidth(), y + child.getMeasuredHeight());

As you can see from the code snippet above, the third parameter is prefixed with x and the fourth with y. Aren't x and y co-ordinates? What's the difference if I do this?

child.layout(x, y, child.getMeasuredWidth(),child.getMeasuredHeight());
Tendai
  • 71
  • 6
  • 1
    The `layout()` method takes `left`, `top`, `right`, and `bottom` arguments; basically, the coordinates for each side. Your example is passing `left`, `top`, `width`, and `height`. See the difference? – Mike M. Aug 09 '21 at 16:24
  • 1
    ‍♂️. Yeah, I do. Thanks. – Tendai Aug 09 '21 at 16:31

0 Answers0