0

こんにちは、私はアンドロイド開発の初心者です..私のアプリケーションでは、次の画像のようにレイアウトを表示したいと考えています:

ここに画像の説明を入力
しかし、代わりにこの画像を取得しています:

http://www.freeimagehosting.net/newuploads/7aqo7.jpg

これが私のコードです:- http://www.freefilehosting.net/bookingform_1

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/bg" >
    <TableRow
        android:id="@+id/tableRow1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/BookingFormRoomLabel"
            android:textColor="@android:color/white" />
        <Spinner
            android:id="@+id/roomspinner"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </TableRow>
    <TableRow
        android:id="@+id/tableRow2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
        <TextView
            android:id="@+id/textView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/BookingFormDocTypeLabel"
            android:textColor="@android:color/white" />
        <Spinner
            android:id="@+id/DocTypeSpinner"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </TableRow>
    <TableRow
        android:id="@+id/tableRow3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
        <TextView
            android:id="@+id/textView3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/BookingFormAdultsLabel"
            android:textColor="@android:color/white" />
        <Spinner
            android:id="@+id/AdultsSpinner"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </TableRow>
    <TableRow
        android:id="@+id/tableRow4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
        <TextView
            android:id="@+id/textView4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/BookinFormChildrensLabel"
            android:textColor="@android:color/white" />
        <Spinner
            android:id="@+id/ChildrensSpinner"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </TableRow>
    <TableRow
        android:id="@+id/tableRow5"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
        <TextView
            android:id="@+id/textView5"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/BookingFormNightsLabel"
            android:textColor="@android:color/white" />
        <Spinner
            android:id="@+id/NightSpinner"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </TableRow>
    <TableRow
        android:id="@+id/tableRow6"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
        <TabHost
            android:id="@android:id/tabhost"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
             android:layout_weight="1">
             <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical" >
                <TabWidget
                    android:id="@android:id/tabs"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" >
                </TabWidget>
                 <FrameLayout
                    android:id="@android:id/tabcontent"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" >
                    <LinearLayout
                        android:id="@+id/tab1"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent" >
                        <TableRow
                            android:id="@+id/tableRow7"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_span="2" >
                            <ImageView
                                android:id="@+id/MainImageView"
                                android:layout_width="200dp"
                                android:layout_height="200dp"
                                android:layout_weight="1"
                                android:contentDescription="@string/BookingFormMainImage"
                                android:src="@drawable/documentsample" />
                            <Button
                                android:id="@+id/button1"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="Button" />

                            <Button
                                android:id="@+id/button2"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:gravity="center_vertical"
                                android:text="Button" />

                        </TableRow>
                        </LinearLayout>
                        <LinearLayout
                        android:id="@+id/tab2"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent" >
                        <ImageView
                            android:id="@+id/SubImageView"
                            android:layout_width="200dp"
                            android:layout_height="200dp"
                            android:contentDescription="@string/BookingFormSubImage"
                            android:src="@drawable/documentsample" />
                        <Button
                            android:id="@+id/BtnSubImageCapture"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:gravity="right"
                            android:text="@string/BtnBookingFormSubImageCapture" />
                        <Button
                            android:id="@+id/BtnSubImageBrowse"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:gravity="right|center"
                            android:text="@string/BtnBookingFormSumbImageBrowse" />
                        <Button
                            android:id="@+id/BtnSubImageDelete"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:gravity="right|center_vertical|center"
                            android:text="@string/BtnBookingFormSubImageDelete" />
                        </LinearLayout>
                        </FrameLayout>
            </LinearLayout>
        </TabHost>
        </TableRow>

4

1 に答える 1

0

LinearLayout保持されたレイアウトorientationをもう 1 つ追加しvertical、それらのボタンをそのレイアウトに保持するだけです。

<LinearLayout
    android:id="@+id/tab2"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
    <ImageView
       android:id="@+id/SubImageView"
       android:layout_width="200dp"
       android:layout_height="200dp"
       android:contentDescription="@string/BookingFormSubImage"
       android:src="@drawable/documentsample" />
       <LinearLayout
           android:id="@+id/buttons_layout"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:orientation="vertical" >
           <Button
               android:id="@+id/BtnSubImageCapture"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:gravity="right"
               android:text="@string/BtnBookingFormSubImageCapture" />
           <Button
               android:id="@+id/BtnSubImageBrowse"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:gravity="right|center"
               android:text="@string/BtnBookingFormSumbImageBrowse" />
           <Button
               android:id="@+id/BtnSubImageDelete"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:gravity="right|center_vertical|center"
               android:text="@string/BtnBookingFormSubImageDelete" />
           <LinearLayout/>
      </LinearLayout>
于 2012-07-29T12:50:36.983 に答える