整体是个 LinearLayout,中间当然要用一个 RelativeLayout 套一层了。

解决方案 »

  1.   

    我试过套一层RelativeLayout在中间,但是套了之后,下边的菜单栏就不见了
      

  2.   

    有几点没搞懂你的意思
    中间的LinearLayout和底部的RelativeLayout的外层的容器是什么,然后你把<RelativeLayout
            android:id="@+id/main"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" >是什么意思,底部menu干嘛要填充全部?下面是我根据我的理解写的
    <?xml version="1.0" encoding="UTF-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
       
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        >
        
        
        
        <!-- 中间图标 -->
       
     
            <ImageView
                android:id="@+id/imageView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher"
                android:layout_centerInParent="true"
                />
             
       
    <!-- 结束中间图标 -->
     
        <!-- 底部菜单 -->
     
        
         
            <LinearLayout android:id="@+id/bottom_panel" 
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content" 
                android:orientation="horizontal" 
                android:layout_alignParentBottom="true" > 
                 
                <include layout="@layout/umeng_socialize_actionbar"/>        
            </LinearLayout> 
                 
        
        </RelativeLayout>
    我把中间的LinearLayout和下面的RelativeLayout去掉了,你看看
      

  3.   

    这么简单的布局,都不好意思拿分。
    <?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:layout_width="match_parent"
            android:layout_height="wrap_content" >
        </LinearLayout>    <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1" >
            <ImageView
                android:id="@+id/imageView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:src="@drawable/more_setting" />    </RelativeLayout>    <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >    </LinearLayout></LinearLayout>
      

  4.   


    中间的LinearLayout和底部的RelativeLayout的外层是LinearLayout,底部的RelativeLayout我是在网上找的布局,可以把菜单固定在屏幕最底部
      

  5.   

    你这个布局最底的那个LinearLayout是不会固定在屏幕最底部的
      

  6.   

    可以用android:layout_centerInParent="true"属性<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity" >    <RelativeLayout
            android:id="@+id/main"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:layout_centerInParent="true">        <ImageView
                android:id="@+id/imageView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="#ff0000"
                android:scaleType="fitXY"
                android:src="@drawable/dog" />
        </RelativeLayout></RelativeLayout>
      

  7.   

    有3个属性
    1)android:layout_centerInParent是否垂直水平是否居中
    2)android:layout_centerHorizontal是否水平居中
    3)android:layout_centerVertical是否垂直居中