Dynamically positioning buttons

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

Dynamically positioning buttons

Postby srajpal » Sat Jan 10, 2009 2:47 am

Is it possible to dynamically move (center on the screen) buttons or other objects when the orientation changes. I know the onCreate is called when the orientation changes but i am not able to change the x or y coordinates of the buttons. What do others do, do you make two layouts for each activity (one for each orientation)?
srajpal
Junior Developer
Junior Developer
 
Posts: 20
Joined: Fri Jan 09, 2009 7:48 pm

Top

Postby Emmanuel7 » Sat Jan 10, 2009 3:52 am

If you just want to have a different setup for each orientation, the simpler is indeed to have two layout files.

If you want to know more on this subject, there is a good tutorial here :
Rotational Forces
Emmanuel7
Senior Developer
Senior Developer
 
Posts: 164
Joined: Fri Dec 12, 2008 2:17 am
Location: Paris

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Majestic-12 [Bot], Yahoo [Bot] and 8 guests