<ImageButton
                android:src="@drawable/ic_launcher"
                android:layout_width="wrap_content"
                android:scaleType="fitCenter" //平均拉伸缩放,还有很多种自己百度
                android:layout_height="100dp" /> //定义高度

解决方案 »

  1.   

        <LinearLayout
                    android:layout_width="fill_content"
                    android:layout_height="fill_content"
    android:orientation=“vertical”
    >
      <ImageButton
                    android:background="@drawable/图片"
                    android:layout_width="wrap_content"
                    android:layout_height="指定高度dp" />
    </LinearLayout>
    另外设置平均高度的话可以去设置weight!
      

  2.   

    因为是高度有800或850,设置android:layout_height="指定高度dp"会出现问题?
    能不能三者按比例啊,上位30%,中40%,下30%,这样设置啊。
    weight=3
    weight=4
    weight=3
    这样没有用啊?
      

  3.   

    LinearLayout下是可以用weight来设置比例的,可能你的写法不对吧!具体的可以去百度下,这个是很基础的问题了!
      

  4.   

    直接写weight就可以,weight=3
    weight=4
    weight=3总的
     <LinearLayout
                    android:layout_width="fill_content"
                    android:layout_height="fill_content"
                    android:layout_weight="10"
    android:orientation=“vertical”
    >