<ImageButton
android:src="@drawable/ic_launcher"
android:layout_width="wrap_content"
android:scaleType="fitCenter" //平均拉伸缩放,还有很多种自己百度
android:layout_height="100dp" /> //定义高度
android:src="@drawable/ic_launcher"
android:layout_width="wrap_content"
android:scaleType="fitCenter" //平均拉伸缩放,还有很多种自己百度
android:layout_height="100dp" /> //定义高度
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!
能不能三者按比例啊,上位30%,中40%,下30%,这样设置啊。
weight=3
weight=4
weight=3
这样没有用啊?
weight=4
weight=3总的
<LinearLayout
android:layout_width="fill_content"
android:layout_height="fill_content"
android:layout_weight="10"
android:orientation=“vertical”
>