【发布时间】:2016-03-02 01:37:34
【问题描述】:
我已经尝试了一些想法来实现以下目标:
对于描述:我想要一个带有 textview 的标题,它包裹在嚎叫页面上,在这个标题下方我想显示三个图像并排显示。它应该像一个图片库。我想复制这个布局。
但我的问题是,我的 ImageView 的高度太高,并且尺寸大小的图像和标题之间存在距离。见图。
左边是我想要的,右边是我得到的......
这是我的布局代码:
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="none"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:textStyle="bold"
android:text="titel"
android:id="@+id/titel"
android:gravity="center"
android:padding="3dp"
android:textSize="18sp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/titel">
<ImageView
android:layout_width="0dp"
android:layout_weight="0.208"
android:layout_height="match_parent"
android:id="@+id/image1"
android:src="@drawable/1"/>
<ImageView
android:layout_width="0dp"
android:layout_weight="0.389"
android:layout_height="match_parent"
android:id="@+id/image2"
android:src="@drawable/2"/>
<ImageView
android:layout_width="0dp"
android:layout_weight="0.403"
android:layout_height="match_parent"
android:id="@+id/image3"
android:src="@drawable/3"/>
</LinearLayout>
</RelativeLayout>
</ScrollView>
【问题讨论】:
标签: android imageview height android-linearlayout percentage