0

4 つの画像ボタンのレイアウトを作成したいと考えています。ボタンが 2 つ並んでいるので、レイアウトでは立方体のように見えます。API Level 8に対応したいのでグリッドレイアウトが使えないので、LinearLayoutの組み合わせでやってみました。

水平方向のルート LinearLayout。これには垂直方向の 2 つの linearlayout が含まれます。これらにはボタンが含まれていますが、期待どおりに機能しません。2 つのボタンを持つ 1 つの行のみが表示されます。誰か助けてくれませんか、ありがとう

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/action_screen"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal" 
        android:paddingTop="30px">

        <LinearLayout 
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="horizontal" >

             <ImageButton
                 android:id="@+id/btn_start_cam"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:onClick="startCamAction"        
                 android:src="@drawable/photo_button" />

             <ImageButton
                 android:id="@+id/btn_photo_lib"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:onClick="startPhotoLibAction"
                 android:src="@drawable/library_blau" />

        </LinearLayout>
        <LinearLayout 
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="horizontal" >

             <ImageButton
                 android:id="@+id/btn_start_barcode"
                 android:onClick="startBarcodeAction"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:src="@drawable/barcode_blau" />

             <ImageButton
                 android:id="@+id/btn_start_qr_barcode"
                 android:onClick="startQRcodeAction"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:src="@drawable/qr_code_blau" />

            </LinearLayout>



    </LinearLayout>
4

1 に答える 1