我想要安装图像,并在其下方安排一些黑色背景和白色文本。我的问题是,布局最终的图像和文字本身之间留有空间,我不明白为什么:Android:在图像下方添加文本
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitStart" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="15dp"
android:layout_below="@+id/image" >
<TextView
style="@style/text_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- Couple more elements -->
</RelativeLayout>
</RelativeLayout>
我想的15dp触碰图像的底部本次RelativeLayout的,但除非我将图像高度改为小一点,会留下一些空间。此布局指定如何显示图像+其下的一些文本,但总共有4个图像使用此布局在屏幕上以2x2显示加载。 (每张图片占用25%的屏幕)。
任何想法如何使RelativeLayout准确地与图像的底部对齐吗?
嗯,我想有一个图像,而下方认为需要它的宽一些文本/图片(某种布局)。布局在两者之间留下间距/填充。 – user1777907