I'm trying to set button position to the bottom right corner of the screen. I've tried with this:
button.setX(maxX);
button.setY(maxY);
but the button is invisible because it's off the screen.
EDIT: To clarify. I need to find a way to keep my button WITHIN layout when I set its position to maxX
and maxY
. To prevent it from going out of bounds. So even if I set its position to something like:
button.setX(maxX - 10);
button.setY(maxY - 10);
it wouldn't stick half out of the screen.