how to move a button?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

how to move a button?

Postby srajpal » Sun Feb 01, 2009 5:36 am

i cannot seem to figure out how to move a button
something like button.setTop(10);

there are gets for the top and left but no sets?

anybody have any ideas how to dynamically and programmatically move a button around the screen?
Junior Developer
Junior Developer
Posts: 20
Joined: Fri Jan 09, 2009 7:48 pm


Postby hebbalhrk » Tue Feb 03, 2009 9:13 am

change the layout parameters of the button.
say if button has LayoutParams buttonLayout= new LayoutParams(100,
150, 20, 50);
programatically set x and y to set new position.
buttonLayout.x= new value..;
buttonLayout.y= new value..;
Posts: 37
Joined: Wed Jun 18, 2008 10:35 am


Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 1 guest