左側にカードの画像が表示されたレイアウトがあります。右側には上部に2つのボタンがあります。次に、その下に2つの画像、2つの画像の下に1つの画像があります。
2枚の画像と1枚の画像を中央に配置してほしい。画像が1つある行は、すべて中央に配置されます。
部分コード
<LinearLayout
android:id="@+id/mainLayout"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal">
<ImageView
    android:id="@+id/viewfacebook"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:src="@drawable/facebook" />
<ImageView
    android:id="@+id/viewmail"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:src="@drawable/mail" />
</LinearLayout> 
2つの画像用の水平コンテナを作成し、重力を中心に設定します。これは機能していません。また、2つの画像の中央に重力を設定しようとしました。しかし....彼らは常に左側にとどまります。
全体のXMLコード
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
    android:id="@+id/mainLayout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:orientation="vertical"></LinearLayout>
<LinearLayout
    android:id="@+id/mainLayout"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:layout_gravity="center"
    android:background="@drawable/background"
    android:orientation="vertical">
    <LinearLayout
        android:id="@+id/mainLayout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:orientation="horizontal">
        <LinearLayout
            android:id="@+id/mainLayout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">
            <ImageView
                android:id="@+id/cardpic"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginRight="5dp"
                android:src="@drawable/bio" />
        </LinearLayout>
        <LinearLayout
            android:id="@+id/mainLayout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">
            <LinearLayout
                android:id="@+id/mainLayout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:orientation="horizontal">
                <ImageView
                    android:id="@+id/buthome"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/ok" />
                <ImageView
                    android:id="@+id/butaffirmation"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/affirmation" />
            </LinearLayout>
            <LinearLayout
                android:id="@+id/mainLayout"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:orientation="horizontal" />
            <ImageView
                android:id="@+id/viewfacebook"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:src="@drawable/facebook" />
            <ImageView
                android:id="@+id/viewmail"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:src="@drawable/mail" />
        </LinearLayout>
        <ImageView
            android:id="@+id/vietwitter"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:src="@drawable/twitter" />
        <LinearLayout
            android:id="@+id/mainLayout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal">
            <TextView
                android:id="@+id/housetext"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text=" *A long and happy marriage or commitment is in your future.\n*Emotional security (loyalty and trust) exists in your relationship.\n*You will have a stable home and family life.\nThe marriage card is about a person who is either going get married or who really cherishes the whole institution of marriage."
                android:textColor="#ff000000"
                android:textSize="18px"
                android:textStyle="bold" />
        </LinearLayout>
    </LinearLayout>
</LinearLayout>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TextView
        android:id="@+id/cardtext"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text=" *A long and happy marriage or commitment is in your future.\n*Emotional security (loyalty and trust) exists in your relationship.\n*You will have a stable home and family life.\nThe marriage card is about a person who is either going get married or who really cherishes the whole institution of marriage."
        android:textColor="#ff000000"
        android:textSize="20dp"
        android:textStyle="bold" />
</ScrollView>
</LinearLayout>