Buttons in TableLayout cropped on Android 1.6 and 2.1 (but not on 1.5 or 2.2)

后端 未结 1 1174
野趣味
野趣味 2021-01-16 13:41

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.

相关标签:
1条回答
  • 2021-01-16 14:30

    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>
    

    0 讨论(0)
提交回复
热议问题