Saturday 19 January 2019

What does android:layout_weight mean?



I don't understand how to use this attribute. Can anyone tell me more about it?


Answer



With layout_weight you can specify a size ratio between multiple views. E.g. you have a MapView and a table which should show some additional information to the map. The map should use 3/4 of the screen and table should use 1/4 of the screen. Then you will set the layout_weight of the map to 3 and the layout_weight of the table to 1.



To get it work you also have to set the height or width (depending on your orientation) to 0px.



No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...