I don't understand how to use this attribute. Can anyone tell me more about it?
Android – What does android:layout_weight mean
androidandroid-layoutandroid-widget
Related Topic
- Android – How to pass data between Activities in Android application
- Android – an Android PendingIntent
- Android – the difference between gravity and layout_gravity in Android
- Android – ‘Context’ on Android
- Android – the difference between match_parent and fill_parent
- Java – How to fix ‘android.os.NetworkOnMainThreadException’
- Sql – What data-type should I use to store monetary values
Best Answer
With
layout_weight
you can specify a size ratio between multiple views. E.g. you have aMapView
and atable
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 thelayout_weight
of themap
to 3 and thelayout_weight
of thetable
to 1.To get it work you also have to set the height or width (depending on your orientation) to 0px.