Easy Android XML changes for many controls

Home / Uncategorized / Easy Android XML changes for many controls

Something that I found recently is the option to change any property of several controls in XML for an Android app (at the same time) using Eclipse.

To do this, simply command click (or control click for windows users) the various objects (fields, widgets, layouts, images, etc) you would like to edit from the Graphical Layout mode.  Then go to the context menu by control clicking (or right clicking) – you may see Layout Width and Layout Height, but under Other Properties->All By Name you get a list of all the possible attributes to be able to edit them at once.  (shown in the image below)

This is a neat feature that helps to speed things up for developing apps with multiple widgets and controls.  Say for instance that you want to line everything up centered horizontally, or add some left padding (7dp), and fit the width to the width of the parent – or add some similar css feature to similar objects… these things can all be done through the context menu!