JoeyCK
JoeyCK

Reputation: 1402

Change Button position

I have a button in an AbsoluteLayout and I want to change the X and Y position on screen programmatically.

How do i it?

Upvotes: 2

Views: 5076

Answers (1)

Nishant Shah
Nishant Shah

Reputation: 3442

First of all you you need to find or add button on view.

And after that you need to set AbsoluteLayout like

btn.setLayoutParams(new LayoutParams(width, height, x, y))

Upvotes: 1

Related Questions