Thursday, 12 July 2012

Android UI Weight

Android weights are like drink mixes, "2 parts vodka, 1 part coffee liqueur". If you set one widget to a weight of 2 and another to a weight of 1 - the first will get 2/3rds of the space and the other will get 1/3rd.
When using weights, it's a good idea to set the layout_width to 0 to improve performance. It improves performance because it doesn't need to work out something that ultimately is irrelevant.

No comments:

Post a Comment