How to arrange several buttons in a line so that the width of all buttons is the same and the free space is completely filled?

tried TableLayout - buttons of different widths

LinearLayout - buttons of different widths and not completely filled space.

Minimum api 10.

    1 answer 1

    Use LinearLayout , each button set the same width (in such cases, I put 0dp) and android:layout_weight="1" .

    The buttons will be the same. If necessary, you can adjust the proportions by changing the value of the layout_weight .