I always read about this funny weight value in the Android documentations. Now I want to try it for the first time but it isn\'t working at all.
As I understand it
In the width field of button, replace wrap-content
with 0dp
.
Use layout_weight attribute of a view.
android:layout_width="0dp"
This is how your code will look like:
layout_weight is used to distribute the whatever left space into proportions. In this case, the two buttons are taking "0dp" width. So, the remaining space will be divided into 1:1 proportion among them, i.e. the space will be divided equally between the Button Views.