I have four buttons arranged in a 2x2 TableLayout. These buttons each have an image on the left and some text. The buttons display fine in the emulator for 1.5, and for 2.
I also ran into the same problem on 1.6 and 2.1 but not on 1.5 nor 2.2.
I use LineraLayout
and set its weight instead and skip the problem using TableLayout
.
<LinearLayout
android:orientation="horizontal" android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout android:layout_width="fill_parent"
android:layout_weight="1" android:layout_height="wrap_content"
android:gravity="center">
<ImageButton
android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout android:layout_width="fill_parent"
android:layout_weight="1" android:layout_height="wrap_content"
android:gravity="center">
<ImageButton
android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout android:layout_width="fill_parent"
android:layout_weight="1" android:layout_height="wrap_content"
android:gravity="center">
<ImageButton
android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>