2

I'm trying to put inside a LinearLayout Horizontal some buttons, but I have the next result.

enter image description here

When they get to the right of the screen, they are not sorted under, they go on. I want that if the screen is small, they are ordered as follows.

enter image description here

Without cut any button.

Thank you. If you need my XML, tell me.

Víctor Martín
  • 3,352
  • 7
  • 48
  • 94

1 Answers1

1

Try setting the LinearLayout width as match parent

android:layout_width="match_parent"
android:layout_height="wrap_content"

Hope it helps :)

Update:

Use GridView and set num_coulums to auto_fit and keep adding buttons as you desire, set width & height as per your requirements

<GridView
    android:id="@+id/gridView1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:columnWidth="100dp"
    android:gravity="center"
    android:numColumns="auto_fit"
    android:stretchMode="columnWidth" >
</GridView>
DroidUser
  • 40
  • 5