I am facing the same problem in this question, but I have difficulty in understanding the exact meaning of the four position parameters in layout(int l, int t, int r, int b)
. I know they represent left, top, right and bottom respectively relative to parent, but "relative" to where exactly?
For example, if I translate the button down 100 pixel, in order to move the clickable area down 100 pixel should I set
// l t r b
button.layout(0, 100, 0, button.getHeight()+100)
? Does the integer 100
of second parameter mean 100 pixel down relative to the top of parent? Is the fourth parameter means button.getHeight()+100
relative to the top of parent also??? I tested on my device, the clickable area does not move down as I want. I'm very confused here, any help is greatly appreciated.
x, y, width, height
already? – Cahillyx
,y
mean? – Loadsbutton.layout(0, 0, 100, 100);
show something? – Cahilly