Проблема макета в андроид - PullRequest
0 голосов
/ 07 июля 2011
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background = "@drawable/second"
    >
 <LinearLayout
  android:layout_width="match_parent" 
    android:id="@+id/LinearLayout1" 
    android:layout_height="match_parent" 
    android:layout_gravity="center" 
    android:baselineAligned="false" android:orientation="vertical"
  >
  <ImageView
        android:id="@+id/ImageView02"
        android:layout_width="wrap_content"  
        android:layout_height="wrap_content"  
        android:src="@drawable/print"  
        android:adjustViewBounds="true"
        android:layout_marginTop ="100dp"
        android:layout_gravity= "center_horizontal"         
          />
  <ImageView
        android:id="@+id/ImageView03"
        android:layout_width="wrap_content"  
        android:layout_height="wrap_content"  
        android:src="@drawable/status"  
        android:adjustViewBounds="true"
        android:layout_gravity= "center_horizontal"
        android:layout_margin="@dimen/menu_item_size"
          />
    <ImageView
        android:id="@+id/ImageView04"
        android:layout_width="wrap_content"  
        android:layout_height="wrap_content"  
        android:src="@drawable/contact"  
        android:adjustViewBounds="true"
        android:layout_gravity= "center_horizontal"
        android:layout_margin="@dimen/menu_item_size"
          />
<ImageView android:layout_width="wrap_content" 
           android:id="@+id/ImageView05" 
           android:layout_gravity="left" 
           android:layout_height="wrap_content" 
           android:src="@drawable/setting" 
           android:adjustViewBounds="true"
           android:layout_marginLeft="10dp">
</ImageView>
<ImageView
        android:layout_width="wrap_content"  
        android:layout_height="wrap_content" 
        android:id="@+id/ImageView06"
        android:src="@drawable/help"  
        android:adjustViewBounds="true"
        android:layout_gravity="right"
        android:layout_marginLeft="10dp"
         />

</LinearLayout>
</LinearLayout>

от того, что я получил первые три изображения по вертикали ... но я хочу, чтобы последние два изображения были по горизонтали в одной строке.я не знаю как добраться.

1 Ответ

0 голосов
/ 07 июля 2011

Создайте еще один LinearLayout в вашем основном LinearLayout. И добавьте первые три изображения в первый LinearLayout и два последних во втором LinearLayout. Ориентация второго LinearLayout будет горизонтальной

...